[Klone-users] setting log level
Stefano Barbato
barbato at koanlogic.com
Thu Sep 27 15:18:14 EDT 2007
Hi Mark,
On Sep 27, 2007, at 7:45 PM, Mark Richards wrote:
> Is there a way to set klone's log level programmatically instead of
> via the klone.conf file?
>
> I find that setting -d at the commandline works, but
>
> debug("whatever")
>
> does not get sent to the logger (or the console), but
>
> warn("whatever")
>
> is sent to the logger.
>
> I am trying to debug it and would like to play with the log level
> settings while the klone daemon is running.
>
> /mark
>
if --enable_debug is not used for the configure script all dbg*()
macros will be stripped out to keep the klone daemon smaller (and a bit
faster). They have been thought to replace assert()s and to let
developers pollute the code with debugging messages without any impact
on the shipped code (i.e. the one compiled without --enable_debug).
For example if the message may be useful in production I usually use
something different the dbg*() macros. I use dbg() mostly to catch
programming errors like testing for NULL pointers or any other
condition that confirms that I coded something in the wrong way.
All other logging priorities (into, notice, warn, err, crit, alert,
emerg and con) will be affected just by syslog configuration and
kloned.conf file, they will not be stripped out by the compiler.
For ex. you can avoid warning messages setting the kloned.conf this way:
log
{
type syslog
syslog
{
facility LOG_LOCAL0
threshold WRN
}
}
If this is not the way you think Klone should work, well....let's talk
about it :-)
bye,
stefano
More information about the klone-users
mailing list