std.experimental.logger default log level is everything

Robert Schadek rschadek at symmetryinvestments.com
Mon May 31 09:03:47 UTC 2021


On Monday, 31 May 2021 at 00:42:50 UTC, Mathias LANG wrote:
> On Friday, 28 May 2021 at 17:29:48 UTC, Steven Schveighoffer 
> wrote:
>> [...]
>>
>> IMO, the default level should be either `off` (no logging) or 
>> `fatal`. I shouldn't see trace messages without opting in to 
>> logging.

The amount of bug reports that lib would have gotten if it were 
off be default
would properly be very large.

To be frank, I would assume everybody replying to this thread, 
would have made
a better job implementing a logger than I did all that time back, 
would be able to
read the docs and insert a:

```D
void main() {
     globalLogLevel = LogLevel.off;
}
```

:-)

>
> I think what makes `std.experimental.logger` unusable inside a 
> public library is the lack of hierarchy. Tango had loggers that 
> were object and hierarchical.
> Ocean has them too: 
> https://github.com/sociomantic-tsunami/ocean/blob/v6.x.x/src/ocean/util/log/Logger.d
>

The docu is properly bad, but you can build hierarchies with 
MultiLogger.


More information about the Digitalmars-d mailing list