digitalmars.D.learn - std.experimental.logger + threadIds
- =?UTF-8?Q?Christian_K=c3=b6stlin?= (8/8) Dec 19 2016 I am experimenting with the logger interface and want to write a custom
- Robert burner Schadek (3/3) Dec 19 2016 The ugly way is to create a @trusted function/lambda that coverts
- =?UTF-8?Q?Christian_K=c3=b6stlin?= (6/10) Dec 19 2016 thanks a lot. works good enough, just for reference, I added:
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
Dec 19 2016
The ugly way is to create a trusted function/lambda that coverts the threadId to a string. Not sure about the pretty way.
Dec 19 2016
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); }
Dec 19 2016