www.digitalmars.com         C & C++   DMDScript  

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


          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

Nov 21 2021