[Issue 22532] New: std.experimental.logger Change default log level to LogLevel.warning, or LogLevel.off
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 21 19:43:25 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22532
Issue ID: 22532
Summary: std.experimental.logger Change default log level to
LogLevel.warning, or LogLevel.off
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: schveiguy at gmail.com
consider a library which wants to provide tracing outputs when using
std.experimental.logger. LogLevel.trace is quite high density, which might log
e.g. the contents of every packet received or sent.
However, the default log level is LogLevel.all.
This means that an application that isn't doing anything with logging gets a
huge wall of text to stderr by including said library. This is a non-starter, a
library cannot use std.experimental.logger.
The default level should probably be `off` or `warning`. Just using a library
should not mean opting into trace output.
For reference:
https://forum.dlang.org/post/s8r9ac$hlt$1@digitalmars.com
https://github.com/mysql-d/mysql-native/pull/187#issuecomment-850554936
--
More information about the Digitalmars-d-bugs
mailing list