Re: looking for recommendation: which thread safe logger library?

2023-07-12 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 09:47:26 UTC, Danilo wrote: On Wednesday, 12 July 2023 at 05:27:27 UTC, mw wrote: But what's wrong with my code? the strange compiler error? Might be a bug/issue in the logger module. `sharedLog` uses the `shared` attribute, but the base class for everything ("ab

Re: looking for recommendation: which thread safe logger library?

2023-07-12 Thread Danilo via Digitalmars-d-learn
WebFreak said you can just use trace(), info() etc. inside threads. It is thread-safe by default. ```d module app; import std.stdio; import std.logger; void main() { //auto file = File("logFile.log", "w"); auto file = stderr; // stdout sharedLog = cast(shared)new FileLogger(file)

Re: looking for recommendation: which thread safe logger library?

2023-07-12 Thread Danilo via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 05:27:27 UTC, mw wrote: But what's wrong with my code? the strange compiler error? Might be a bug/issue in the logger module. `sharedLog` uses the `shared` attribute, but the base class for everything ("abstract class Logger") does not use the `shared` attribute a

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 04:48:23 UTC, Danilo wrote: On Wednesday, 12 July 2023 at 01:55:00 UTC, mw wrote: ``` import std.experimental.logger; void main() { std.experimental.logger.sharedLog.trace("msg"); } ``` See examples at https://dlang.org/phobos/std_logger.html and https://dlan

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread Danilo via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:55:00 UTC, mw wrote: ``` import std.experimental.logger; void main() { std.experimental.logger.sharedLog.trace("msg"); } ``` See examples at https://dlang.org/phobos/std_logger.html and https://dlang.org/phobos/std_logger_filelogger.html ```d import std.st

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:26:25 UTC, mw wrote: On Wednesday, 12 July 2023 at 01:24:41 UTC, mw wrote: Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Oh, forget to mention: need output to lo

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:24:41 UTC, mw wrote: Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Oh, forget to mention: need output to logger file.

looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Thanks.