Re: Logging best practices

2020-05-31 Thread Luis via Digitalmars-d-learn
On Sunday, 31 May 2020 at 20:04:11 UTC, mw wrote: Thanks. For the colored console logger, I'm using this one: https://code.dlang.org/packages/colored-logger so far so good. (I prefer to use library, instead of reinvent my own wheels :-). I dind't know that exists. 👍

Re: Logging best practices

2020-05-31 Thread mw via Digitalmars-d-learn
On Sunday, 31 May 2020 at 07:49:01 UTC, Luis wrote: On Saturday, 30 May 2020 at 18:17:21 UTC, mw wrote: A related question: how to log to multiple destinations? e.g. both console & log file? any examples? Thanks. ```D auto multiLogger = new MultiLogger(); multiLogger.insertLogger("console"

Re: Logging best practices

2020-05-31 Thread Luis via Digitalmars-d-learn
On Saturday, 30 May 2020 at 18:17:21 UTC, mw wrote: A related question: how to log to multiple destinations? e.g. both console & log file? any examples? Thanks. ```D auto multiLogger = new MultiLogger(); multiLogger.insertLogger("console", new FileLogger(stdout, LogLevel.all)); multiLogger

Re: Logging best practices

2020-05-30 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 30 May 2020 at 18:17:21 UTC, mw wrote: On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept me away from

Re: Logging best practices

2020-05-30 Thread mw via Digitalmars-d-learn
On Monday, 29 April 2019 at 16:02:25 UTC, Arun Chandrasekaran wrote: std.experimental.logger is perfectly thread safe. However printing the logging thread ID is still pending with this PR https://github.com/dlang/phobos/pull/6978 Also is any file logger thread safe?

Re: Logging best practices

2020-05-30 Thread mw via Digitalmars-d-learn
On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept me away from it. Is it good, or are there any better alternativ

Re: Logging best practices

2019-04-29 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Sat, Apr 27, 2019 at 2:55 AM Andre Pany via Digitalmars-d-learn wrote: > > On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm > wrote: > > Hello. > > > > Is there a current "Best Practices" for logging in D? > > > > For the actual logging, I know of `std.experimental.logger`. > > Ho

Re: Logging best practices

2019-04-27 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept me away from it. Is it good, or are there any better alternativ

Re: Logging best practices

2019-04-26 Thread dangbinghoo via Digitalmars-d-learn
On Friday, 26 April 2019 at 08:10:33 UTC, Bastiaan Veelo wrote: std.experimental has been already moved to std. Are you sure about that? https://github.com/dlang/phobos/tree/master/std I think you are confusing the package std.experimental.all that moved to std. It means you can now import al

Re: Logging best practices

2019-04-26 Thread Bastiaan Veelo via Digitalmars-d-learn
On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept me away from it. Is it good, or are there any better alternativ

Re: Logging best practices

2019-04-26 Thread Bastiaan Veelo via Digitalmars-d-learn
On Thursday, 25 April 2019 at 15:51:43 UTC, dangbinghoo wrote: On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept m

Re: Logging best practices

2019-04-25 Thread dangbinghoo via Digitalmars-d-learn
On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm wrote: Hello. Is there a current "Best Practices" for logging in D? For the actual logging, I know of `std.experimental.logger`. However, the `experimental` has kept me away from it. Is it good, or are there any better alternativ