clixon_netconf -S is obsolete. Use clixon_netconf -l s instead.
* Unified log handling for all clicon applications using -l e|o|s|f. * The options stand for e:stderr, o:stdout, s: syslog, f:file
This commit is contained in:
parent
5164db3603
commit
e48f8dd00e
9 changed files with 116 additions and 90 deletions
|
|
@ -105,7 +105,36 @@ clicon_log_exit(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* If log flags include CLICON_LOG_FILE, set the file
|
||||
/*! Utility function to set log destination/flag using command-line option
|
||||
* @param[in] c Log option,one of s,f,e,o
|
||||
* @retval -1 No match
|
||||
* @retval 0 One of CLICON_LOG_SYSLOG|STDERR|STDOUT|FILE
|
||||
*/
|
||||
int
|
||||
clicon_log_opt(char c)
|
||||
{
|
||||
int logdst = -1;
|
||||
|
||||
switch (c){
|
||||
case 's':
|
||||
logdst = CLICON_LOG_SYSLOG;
|
||||
break;
|
||||
case 'e':
|
||||
logdst = CLICON_LOG_STDERR;
|
||||
break;
|
||||
case 'o':
|
||||
logdst = CLICON_LOG_STDOUT;
|
||||
break;
|
||||
case 'f':
|
||||
logdst = CLICON_LOG_FILE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return logdst;
|
||||
}
|
||||
|
||||
/*! If log flags include CLICON_LOG_FILE, set the file
|
||||
* @param[in] filename File to log to
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
|
|
|
|||
|
|
@ -1070,10 +1070,10 @@ xpath_vec_ctx(cxobj *xcur,
|
|||
clicon_err(OE_XML, 0, "XPATH parser error with no error code (should not happen)");
|
||||
goto done;
|
||||
}
|
||||
if (debug){
|
||||
if (debug > 1){
|
||||
cbuf *cb = cbuf_new();
|
||||
xpath_tree_print(cb, xy.xy_top);
|
||||
clicon_debug(1, "xpath parse tree:\n%s", cbuf_get(cb));
|
||||
clicon_debug(2, "xpath parse tree:\n%s", cbuf_get(cb));
|
||||
cbuf_free(cb);
|
||||
}
|
||||
xc.xc_type = XT_NODESET;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue