std.logger issue

Krzysztof Jajeśnica krzysztof.jajesnica at gmail.com
Thu Jan 26 20:08:51 UTC 2023


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.


More information about the Digitalmars-d-learn mailing list