On 08/02/12 12:29 +0000, Dietmar Maurer wrote:
I want to adjust logging level when enable/disable debug mode - can I
do it that way?
This will send the debug log messages to syslog, but you probably
also want to artifically "bump" the level up to actually get
them into the log (assuming your syslog is set at INFO)
To allow this, call the below once
qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
LOG_INFO - LOG_DEBUG);
so before logging it gets priority + bump (which is negative)
and so converts a debug into an info.
-Angus
static void update_log_filters(int debug) {
if (debug) {
qb_log_filter_ctl(QB_LOG_SYSLOG, QB_LOG_FILTER_ADD,
QB_LOG_FILTER_FILE, "*", LOG_DEBUG);
} else {
qb_log_filter_ctl(QB_LOG_SYSLOG, QB_LOG_FILTER_ADD,
QB_LOG_FILTER_FILE, "*", LOG_INFO);
}
}
Or what is the suggested way?
- Dietmar
_______________________________________________
quarterback-devel mailing list
quarterback-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/quarterback-devel