Gmane
From: Markus Schöpflin <markus.schoepflin <at> ginit-technology.com>
Subject: Re: Proposal: Logging library
Newsgroups: gmane.comp.lib.boost.devel
Date: 2002-04-09 10:31:08 GMT (6 years, 26 weeks, 4 days, 13 hours and 45 minutes ago)
Andras Erdei wrote:
> 
> IMHO levels are the worst solution. Usually i want things like
> "get all error messages, but get the warnings only from two modules".
> There are two independent criteria for enabling/disabling a message:
> the type and the source of the message. The other problem is that
> everyone wants different levels, and uses the painfully agreed-on
> levels differently.

I agree with your classification of type and source but I think
that support for predefined levels is a must.

> 
> What i'm contemplating right now is basing the filtering on pattern
> matching. There is an "enable" filter -- a list of patterns, like
> ["^WARNING TCPIP *", "^WARNING INTERPRET *unknown*" , "^ERROR *" ];
> a message not matching any of the patterns on the enable list is ignored.
> Of course if you tend to be terse, you can use [ "^WT*" , "^WI*unknown*" ,
>  "^E*" ] or whatever you prefer instead, and start your messages with
> a single letter indicating the "level" of the message.
> There is also a "disable" filter -- again a list of patterns which
> can be used to get rid of some of the messages making it through the
> enable filter. (In theory a single regexp is sufficient but that
> would be cumbersome.)

Interesting. How do you generate the log messages? A simple
log("WARNING TCPIP whatever")? 

> 
> What i don't know is whether a full-regexp matching is preferable
> (with all the speed consequences) or a simple wild-card matching
> ('*' and '?'/'.').

Don't you think there is still too much of a speed penalty for using
a pattern matching algorithm? Especially if you think about multiple
sinks, and each sink using a different setting of filters.

[snip rest of message]

Markus
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost