Implementing std.log
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat May 14 14:50:34 PDT 2011
On 05/14/2011 04:31 PM, Jonathan M Davis wrote:
> On 2011-05-14 12:36, Andrei Alexandrescu wrote:
>> On 05/14/2011 01:29 PM, dsimcha wrote:
>>> On 5/14/2011 1:04 PM, Andrei Alexandrescu wrote:
>>>> On 5/9/11 1:52 AM, Andrei Alexandrescu wrote:
>>>> [snip]
>>>>
>>>> I updated my std.log draft. Added a lot of features including formatted
>>>> writing, delayed logging, and a variety of configuration options.
>>>> Replaced the redundant log.xyz with logXyz. The implementation is
>>>> getting close to reviewable form.
>>>>
>>>> Documentation:
>>>>
>>>> http://d-programming-language.org/phobos-prerelease/std_log.html
>>>>
>>>> Source:
>>>>
>>>> https://github.com/andralex/phobos
>>>>
>>>> Feedback welcome.
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Andrei
>>>
>>> Overall, I like this library a lot. One comment, though, is that the
>>> docs should be more explicit about threading issues. I assume it's going
>>> to be made thread-safe before inclusion in Phobos. Also, is there any
>>> way to get thread-specific logs instead of having them intermingled?
>>
>> Logs will be thread-shared. I haven't seen a need for thread-local logs.
>
> I've dealt with code before where it was critical to know which log messages
> came from which thread if you had any hope of debugging what was going on.
Just like glog, std.log outputs the thread ID for each log line. See the
eighth parameter of
http://d-programming-language.org/phobos-prerelease/std_log.html#logLinePrefix
Andrei
More information about the Digitalmars-d
mailing list