www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22532] New: std.experimental.logger Change default log level

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 puremagic.com
          Reporter: schveiguy 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

--
Nov 21 2021