Thread overview
std.experimental.logger + threadIds
Dec 19, 2016
Christian Köstlin
Dec 19, 2016
Christian Köstlin
December 19, 2016
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
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
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);
}