On 27/04/11 18:46, Harald Welte wrote:
Hi Pablo!
I've recently received a bug report that somehow the config-file-stored
configuration of which log levels/subsystems to enable on stderr don't work.
This may be related to the legacy "-d DINP:DNM:... style log level
specifications, e.g. we first read the config file and then set some default
logging options usign the legacy version.
It seems to be the opposite as for the existing code.
Maybe you can find some time to investigate and fix
the issue.
Looking at the code, we first parse the command line options and, then,
the config file (by calling bsc_bootstrap_network).
Extracted from libosmocore/src/vty/logging_vty.c:
DEFUN(cfg_log_stderr, cfg_log_stderr_cmd,
"log stderr",
LOG_STR "Logging via STDERR of the process\n")
{
struct log_target *tgt;
tgt = log_target_find(LOG_TGT_TYPE_STDERR, NULL);
if (!tgt) {
tgt = log_target_create_stderr();
if (!tgt) {
vty_out(vty, "%% Unable to create stderr log%s",
VTY_NEWLINE);
return CMD_WARNING;
}
log_add_target(tgt);
}
In the config file parsing, it seems that we skip adding a logging
target of stderr type if we already got one for stderr.
This looks fine to me, since the command line options should override
the config file settings. Should we consider this feature instead of a
bug? :-)