Another Log implementation

Jose Armando Garcia jsancio at gmail.com
Mon May 30 09:37:01 PDT 2011


On Mon, May 30, 2011 at 11:50 AM, Vincent <thornik at gmail.com> wrote:
> On Mon, 30 May 2011 16:01:21 +0200, David Nadlinger <see at klickverbot.at>
> wrote:
>
>> In terms of code, e.g. here:
>>
>> https://github.com/jsancio/phobos/blob/master/std/log.d#L864
>
> Great! Didn't catch it from docs, sorry. Anyway, it's not 'verbosity' as
> meaning in english - it's FILTERING and yep, this is useful. But all those
> 'verbose level 1, 2, 3....' that's ridiculous.
>

Actually the sample space for verbose logging is [short.min,
short.max] (using set notation). You don't have to use them if you
don't want to. You can always use verbose level 1 and do filtering
only based on the module. You can even create your own logical module
that doesn't map to source files as follow.

---
string specialModule;

vlog(1, specialModule)(...)
---

I should state though that, this is not recommended. Use at your own risk! ;)

>> I was referring to the post of you I actually cited, where you wrote:
>>
>> ---
>> In this case I prefer snippets like this:
>>
>> // some IO logic
>> version(log_io) logDbg(`SENT: ` ~ line);
>> ---
>>
>> Clearly, you can't activate/deactivate logging at runtime here
>
> You can, see Log.IsEnabled member.
>
>> No offense intended, but could you please try to respect common
>> newsgroup/mailing list etiquette and actually read the posts you are
>> replying to?
>
> Strange statement... are you stupid or you make me stupid? How I physically
> can answer on message if I didn't read it?? I read it, try to understand and
> reply. What's wrong you found here?
>


More information about the Digitalmars-d mailing list