std.logger issue

o3o dlang at orfeo.fastmail.com
Fri Jan 27 07:56:40 UTC 2023


On Thursday, 26 January 2023 at 20:08:51 UTC, Krzysztof Jajeśnica 
wrote:
> On Thursday, 26 January 2023 at 17:17:28 UTC, o3o wrote:
>> how can I enable `trace` level?
>
> Set `sharedLog.logLevel` instead of `globalLogLevel`.
>
> ```d
> // Note: the cast is needed because sharedLog is shared
> (cast()sharedLog).logLevel = LogLevel.all;
> ```
>
> Explanation: logging functions (`trace`, `log`, etc.) called 
> without a logger perform the logging using a global logger 
> called `sharedLog`. `sharedLog` uses `LogLevel.info` by 
> default, which is why your trace messages were not showing.

Thank you very much Krzysztof, it works.


More information about the Digitalmars-d-learn mailing list