New log-level like info #240
Labels
No labels
bug
duplicate
easy
enhancement
help wanted
invalid
question
rfc
structured-logging
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-rust-lang/log#240
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I would like to use another log-level similar to INFO, like the Unix syslog uses LOG_NOTICE. Would it be possible to extend the crate this way?
http://man7.org/linux/man-pages/man3/syslog.3.html
I'm a bit uncomfortable with making changes like this, since it seems like you'd end up supporting every level used by every logging thing in existence.
Yes, it would open up they way to request each possible loglevel.
Maybe it's possible (with an API-break) to use an u8 instead of an enum and define the macros with 40 = trace, 80 = debug, …, 200 = error and leave it up to the logger how to handle the values. A syslog logger might map everything <= 80 to debug, 81…120 to info, 121…140 to notice, 161…200 error, 201…220 critical, 221…240 alert, 241…255 emergency.
Now every logger has to decide how they render log level 43 vs log level 47.
And libraries that want to log things need to decide if they want to use log level 43 vs log level 47.
Yes, right, that sounds helpful. This would open the logging system for extensions. Libs or apps which are targeting syslog for example, might include a syslog crate which provides the additional macros for the other loglevels.
If a crate knows it's only targeting syslog, it can use a syslog-specific logger that has all of the levels it cares about.
I'm talking about the vast majority of crates that don't know or care what kind of logger they are being hooked into.