std.experimental.logger formal review round 3

via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 7 07:30:47 PDT 2014


On Sunday, 5 October 2014 at 23:40:32 UTC, Kevin Lamonte wrote:
> On Sunday, 5 October 2014 at 17:06:06 UTC, Sean Kelly wrote:
>
>> Having an identifier for logging is a bit different.  Would 
>> using the MessageBox address be sufficient?  I'd be happy to 
>> add a Tid.id property that returns a value like this.  I'd 
>> rather not try to generate a globally unique identifier though 
>> (that would probably mean a UUID, which is long and expensive 
>> to generate).
>
> I think Tid.id returning the MessageBox address would be fine 
> for logging purposes.  The main value is being able to 
> distinguish messages coming in at the same time from multiple 
> threads.  Even if a MessageBox address was re-used by a new 
> receive()er after a previous one exited I doubt it would 
> confuse users very much.  I thing that a doc on Tid.id like 
> "this value will not be the same as any other Tid currently 
> existing, but might be the same as a Tid that has exited 
> previously" would be sufficient.

A moving GC can affect the address, too, but for your purpose it 
would still be fine, you just mustn't put too much significance 
into the actual value.


More information about the Digitalmars-d mailing list