[Issue 24468] stdThreadLocalLog does not print `log` and `trace` logs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 29 22:25:48 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24468

kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke <kinke at gmx.net> ---
According to the docs
(https://dlang.org/phobos/std_logger_core.html#.stdThreadLocalLog),
`stdThreadLocalLog` just forwards to `sharedLog`. The latter has a default
LogLevel of info. So in your example, you'd need to set the
`sharedLog.logLevel` *before* logging to `stdThreadLocalLog` (which defaults to
`LogLevel.all`, forwarding everything to the shared logger).

The key info is in the std.logger package docs
(https://dlang.org/phobos/std_logger.html):
> The LogLevel of the stdThreadLocalLog can be used to filter log calls before they reach the sharedLog Logger.

Perhaps this should be duplicated in the documentation for the
`stdThreadLocalLog` property.

--


More information about the Digitalmars-d-bugs mailing list