Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upGuideline for logging in libraries #65
Comments
This comment has been minimized.
This comment has been minimized.
|
One thing we should note here is how to think about error levels. In particular, |
This comment has been minimized.
This comment has been minimized.
WiSaGaN
commented
Sep 14, 2017
|
It would be very hard to detail concrete guidelines for log meaning and format, which I think is itself a major topic. It also seems out of scope of an API guidelines. Simple libraries can rely more on unit tests, and let user choose whether to log information or not. More sophisticated libraries indeed need some level of logging to help debug internal state. Maybe it should mostly be implemented in DEBUG level and TRACE level, but not INFO. Making it opt-in like
The question for this approach is that how we can avoid writing conditional compiling directive in every log line. |
dtolnay commentedMay 18, 2017
What sorts of things should be logged, what volume of logging is appropriate, and how to make it maximally flexible for the downstream application. Once
logis 1.0, this may just be "uselog."