-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Reworking logs
metalefty edited this page Jul 27, 2017
·
8 revisions
Eliminate all logs written to stdout/stdout. All logs should be written to log files. Don't have user to run xrdp/xrdp-sesman in foreground to investigate issues.
g_writeln()
log_message()
-
LLOGLN()
macro usesg_writeln()
-
LLOG()
macro usesg_write()
-
DEBUG()
macro usesg_writeln()
(debug build only) -
LOG_DBG()
macro useslog_message(LOG_LEVEL_DEBUG, )
(debug build only)
and more.
Almost all logs should be logged via log_message()
as far as possible.
Log level TRACE is newly introduced log level which means more verbose then DEBUG.
-
log_always(args..)
->log_message(LOG_LEVEL_ALWAYS, args)
-
log_error(args..)
->log_message(LOG_LEVEL_ERROR, args)
-
log_warning(args..)
->log_message(LOG_LEVEL_WARNING, args)
-
log_info(args..)
->log_message(LOG_LEVEL_INFO, args)
-
log_debug(args..)
->log_message(LOG_LEVEL_DEBUG, args)
-
log_trace(args..)
->log_message(LOG_LEVEL_TRACE, args)
-
log_trace_verbose(args..)
->log_message(LOG_LEVEL_TRACE, args)
(debug build only)
#define log_always(args..) log_message(LOG_LEVEL_ALWAYS, args);
#define log_error(args..) log_message(LOG_LEVEL_ERROR, args);
#define log_warning(args..) log_message(LOG_LEVEL_WARNING, args);
#define log_info(args..) log_message(LOG_LEVEL_INFO, args);
#define log_debug(args..) log_message(LOG_LEVEL_DEBUG, args);
#define log_trace(args..) log_message(LOG_LEVEL_TRACE, args);
#if defined(XRDP_DEBUG)
#define log_trace_verbose(args..) log_message(LOG_LEVEL_TRACE, args);
#else
#define log_trace_verbose(args..)
#endif
Limited to using really need to write stdout. Ex. output of xrdp -h
.
-
g_writeln()
->log_trace()
-
LOG_DBG()
->log_trace_verbose()