-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log
crate?
#596
Comments
I like this idea. Have felt the need to debug by printing messages while implementing a few algos in this crate. On a related note, should we add Debug to the traits defining |
I'm in favor of that. It's technically a geo-types breaking change though 😢. |
Bah. We should do both, though. Debugging is enough of a pain as it is. |
Just in case I wasn't clear, I agree that we should do it. I wonder if there's some slightly graceful way we could introduce this feature in a way that allows deprecation first. Like introduce a new trait that implements Debug - maybe by way of #540? edit: to clarify - #540 is about Coordinate, not CoordinateType, but I think a similar idea of deprecation and renaming is at play. And maybe it makes sense to do both at the same time to "rip off the bandaid". |
Created a new issue for the @michaelkirk Back to this issue, do you have an example of where logging in this crate would be helpful? I'm fine with this, just want to get an idea of how it'll get implemented. |
There's currently a few I think typically I'm just adding println's and deleting it before committing. Which is fine. But clear understandable logging takes some effort, and if you revisit code later you have to re-implement that logging, so there can be tension between writing "good" logging and writing "quick" logging since you're always reimplementing it. At the moment I'm specifically interested in keeping some of the logging around tha I've written while debugging the denim stuff. I'd prefer to keep in some lines like this at a
You can grep that commit for As a side note, I usually turn to the I can say |
added in #639 |
What would folks think of starting to use the
log
crate in geo?In general, I think high quality permanent logging is a worthwhile addition to the software, especially as more outside people use the crate and encounter errors.
But for me this was spurred by the work I'm doing in #515, some of which is pretty complicated. Consequently I've introduced some non-trivial logging while I work out the bugs. I think some of this would be valuable to keep around if future problems arise or changes made. Typically I just delete my
print
statements once I'm confident everything is working, but since this is a larger more complicated component, my preference would be to leave some of it in - mostly atdebug!
or lower log levels, so people won't typically see it.The
log
crate is already used transitively by some of our features (postgres, proj_network) but it's not currently required by the default geo build.The biggest shortcoming I see is that I know of only awkward ways to utilize it while developing locally and while testing, e.g. https://stackoverflow.com/questions/30177845/how-to-initialize-the-logger-for-integration-tests
The text was updated successfully, but these errors were encountered: