log: add log level TRACE
TRACE means more verbose than DEBUG. syslog doesn't have more verbose level than DEBUG, map TRACE to DEBUG for syslog.
This commit is contained in:
parent
eaed9af498
commit
2411a0be14
@ -94,6 +94,7 @@ internal_log_xrdp2syslog(const enum logLevels lvl)
|
|||||||
case LOG_LEVEL_INFO:
|
case LOG_LEVEL_INFO:
|
||||||
return LOG_INFO;
|
return LOG_INFO;
|
||||||
case LOG_LEVEL_DEBUG:
|
case LOG_LEVEL_DEBUG:
|
||||||
|
case LOG_LEVEL_TRACE:
|
||||||
return LOG_DEBUG;
|
return LOG_DEBUG;
|
||||||
default:
|
default:
|
||||||
g_writeln("Undefined log level - programming error");
|
g_writeln("Undefined log level - programming error");
|
||||||
@ -128,6 +129,9 @@ internal_log_lvl2str(const enum logLevels lvl, char *str)
|
|||||||
case LOG_LEVEL_DEBUG:
|
case LOG_LEVEL_DEBUG:
|
||||||
snprintf(str, 9, "%s", "[DEBUG] ");
|
snprintf(str, 9, "%s", "[DEBUG] ");
|
||||||
break;
|
break;
|
||||||
|
case LOG_LEVEL_TRACE:
|
||||||
|
snprintf(str, 9, "%s", "[TRACE] ");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(str, 9, "%s", "PRG ERR!");
|
snprintf(str, 9, "%s", "PRG ERR!");
|
||||||
g_writeln("Programming error - undefined log level!!!");
|
g_writeln("Programming error - undefined log level!!!");
|
||||||
@ -254,6 +258,11 @@ internal_log_text2level(const char *buf)
|
|||||||
{
|
{
|
||||||
return LOG_LEVEL_DEBUG;
|
return LOG_LEVEL_DEBUG;
|
||||||
}
|
}
|
||||||
|
else if (0 == g_strcasecmp(buf, "5") ||
|
||||||
|
0 == g_strcasecmp(buf, "trace"))
|
||||||
|
{
|
||||||
|
return LOG_LEVEL_TRACE;
|
||||||
|
}
|
||||||
|
|
||||||
g_writeln("Your configured log level is corrupt - we use debug log level");
|
g_writeln("Your configured log level is corrupt - we use debug log level");
|
||||||
return LOG_LEVEL_DEBUG;
|
return LOG_LEVEL_DEBUG;
|
||||||
|
@ -33,7 +33,8 @@ enum logLevels
|
|||||||
LOG_LEVEL_ERROR,
|
LOG_LEVEL_ERROR,
|
||||||
LOG_LEVEL_WARNING,
|
LOG_LEVEL_WARNING,
|
||||||
LOG_LEVEL_INFO,
|
LOG_LEVEL_INFO,
|
||||||
LOG_LEVEL_DEBUG
|
LOG_LEVEL_DEBUG,
|
||||||
|
LOG_LEVEL_TRACE
|
||||||
};
|
};
|
||||||
|
|
||||||
/* startup return values */
|
/* startup return values */
|
||||||
|
Loading…
Reference in New Issue
Block a user