Guideline for logging in libraries #65
Replies: 2 comments
-
One thing we should note here is how to think about error levels. In particular, |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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
log
is 1.0, this may just be "uselog
."Beta Was this translation helpful? Give feedback.
All reactions