Review of Jose Armando Garcia Sancio's std.log

Jose Armando Garcia jsancio at gmail.com
Tue Mar 6 13:49:26 PST 2012


On Tue, Mar 6, 2012 at 1:08 PM, Brad Roberts <braddr at puremagic.com> wrote:
> On Tue, 6 Mar 2012, Jose Armando Garcia wrote:
>
>> Future:
>>
>> 1. Allowing filtering of regular log messages (like info, warning,
>> etc) based on the module. Similar to how vlog works.
>
> Once you add module filtering to the regularly log messages, what's the
> point of having the separate vlog?  I think this needs to be figured out
> before merge, not at some vague future.
>

That is true the need for vlog is lessen from a configuration point of
view but not from a performance point of view.

Adding module filtering to info, warning, etc increases the
computational cost of determining if you should log. Right now that
computational cost is constant. It is equal to a comparison operation.
If you want module base filtering the computational complexity will
probably be O(n + l) where n is the number of modules/entry in the
filter and l is the minimum between the length of the module/file name
and the length of the filters.

This makes info, warning, error a great tool to use in production
across your program. While you can use vlog on a case by case basis in
testing environments.

Thanks,
-Jose

>> Fix now:
>>
>> 1. Add thread name attribute to the default logger
>> 2. Check that the example compile
>> 3. Come up with a better name for Rich and rich template
>> 4. Add @safe pure nothrow const to as many methods as possible
>> 5. Remove check when setting Configuration.logger
>
> I still believe pretty strongly that the logger must not affect
> application flow, ie, not throw or exit the app.  From the feed back, I am
> not alone in thinking that.  I don't believe that "well, don't use those
> log levels" is a workaround if for no other reason that there will be
> libraries that contain them and that becomes a "dont use those libraries
> either" response.
>
> My 2 cents,
> Brad
>


More information about the Digitalmars-d mailing list