Thread overview | |||||
---|---|---|---|---|---|
|
December 19, 2016 std.experimental.logger + threadIds | ||||
---|---|---|---|---|
| ||||
I am experimenting with the logger interface and want to write a custom logger, that also outputs the threadID or Tid of the LogEntries. The documentation shows how to do a custom logger, but I am unable to convert the threadId to a string, because all conversion functions are not @safe. Is there a way around this? Thanks in advance, Christian |
December 19, 2016 Re: std.experimental.logger + threadIds | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christian Köstlin | The ugly way is to create a @trusted function/lambda that coverts the threadId to a string. Not sure about the pretty way. |
December 19, 2016 Re: std.experimental.logger + threadIds | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert burner Schadek | On 19/12/2016 21:32, Robert burner Schadek wrote:
> The ugly way is to create a @trusted function/lambda that coverts the threadId to a string.
>
> Not sure about the pretty way.
thanks a lot. works good enough, just for reference, I added:
string tid2string(Tid id) @trusted {
import std.conv : text;
return text(id);
}
|
Copyright © 1999-2021 by the D Language Foundation