March 29 [Issue 24468] New: stdThreadLocalLog does not print `log` and `trace` logs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24468 Issue ID: 24468 Summary: stdThreadLocalLog does not print `log` and `trace` logs Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: ttanjo@gmail.com I reproduce this issue with dmd 2.107.1 on Ubuntu 22.04 and run.dlang.io. I cannot reproduce this issue with `shaledLog`. # PoC code ```dlang import std.logger, std.stdio; void main() { writeln("==== stdThreadLocalLog ===="); stdThreadLocalLog.logLevel = LogLevel.all; stdThreadLocalLog.log("log"); stdThreadLocalLog.trace("trace"); stdThreadLocalLog.info("info"); stdThreadLocalLog.warning("warning"); stdThreadLocalLog.error("error"); stdThreadLocalLog.critical("critical"); writeln("==== sharedLog ===="); (cast()sharedLog).logLevel = LogLevel.all; (cast()sharedLog).log("log"); (cast()sharedLog).trace("trace"); (cast()sharedLog).info("info"); (cast()sharedLog).warning("warning"); (cast()sharedLog).error("error"); (cast()sharedLog).critical("critical"); } ``` # Expected output Both loggers print `all`, `trace`, `info`, `warning`, `error` and `critical` logs. ``` ==== stdThreadLocalLog ==== 2024-03-29T18:38:03.881 [all] onlineapp.d:16:main log 2024-03-29T18:38:03.881 [trace] onlineapp.d:17:main trace 2024-03-29T18:38:03.881 [info] onlineapp.d:9:main info 2024-03-29T18:38:03.881 [warning] onlineapp.d:10:main warning 2024-03-29T18:38:03.881 [error] onlineapp.d:11:main error 2024-03-29T18:38:03.881 [critical] onlineapp.d:12:main critical ==== sharedLog ==== 2024-03-29T18:38:03.881 [all] onlineapp.d:16:main log 2024-03-29T18:38:03.881 [trace] onlineapp.d:17:main trace 2024-03-29T18:38:03.881 [info] onlineapp.d:18:main info 2024-03-29T18:38:03.881 [warning] onlineapp.d:19:main warning 2024-03-29T18:38:03.882 [error] onlineapp.d:20:main error 2024-03-29T18:38:03.882 [critical] onlineapp.d:21:main critical ``` # Actual behavior `sharedLog` prints all the logs but `stdThreadLocalLog` lacks `all` and `trace` logs. ``` ==== stdThreadLocalLog ==== 2024-03-29T18:38:03.881 [info] onlineapp.d:9:main info 2024-03-29T18:38:03.881 [warning] onlineapp.d:10:main warning 2024-03-29T18:38:03.881 [error] onlineapp.d:11:main error 2024-03-29T18:38:03.881 [critical] onlineapp.d:12:main critical ==== sharedLog ==== 2024-03-29T18:38:03.881 [all] onlineapp.d:16:main log 2024-03-29T18:38:03.881 [trace] onlineapp.d:17:main trace 2024-03-29T18:38:03.881 [info] onlineapp.d:18:main info 2024-03-29T18:38:03.881 [warning] onlineapp.d:19:main warning 2024-03-29T18:38:03.882 [error] onlineapp.d:20:main error 2024-03-29T18:38:03.882 [critical] onlineapp.d:21:main critical ``` -- |
Copyright © 1999-2021 by the D Language Foundation