looking for recommendation: which thread safe logger library?

mw m at g.c
Wed Jul 12 01:55:00 UTC 2023


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 logger file.

tried:

https://run.dlang.io/is/ufy4yF

```
import std.experimental.logger;

void main() {
     std.experimental.logger.sharedLog.trace("msg");
}
```

but:

onlineapp.d(4): Error: none of the overloads of template 
`std.logger.core.Logger.memLogFunctions!LogLevel.trace.logImpl` 
are callable using argument types `!()(string) shared`
/dlang/dmd/linux/bin64/../../src/phobos/std/logger/core.d(734):   
      Candidates are: `logImpl(int line = __LINE__, string file = 
__FILE__, string funcName = __FUNCTION__, string prettyFuncName = 
__PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)(lazy A 
args)`
/dlang/dmd/linux/bin64/../../src/phobos/std/logger/core.d(780):   
                      `logImpl(int line = __LINE__, string file = 
__FILE__, string funcName = __FUNCTION__, string prettyFuncName = 
__PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)(lazy 
bool condition, lazy A args)`


so, how to fix this compiler error?


More information about the Digitalmars-d-learn mailing list