GUACAMOLE-259: Merge addition of new TRACE log level.

This commit is contained in:
James Muehlner 2017-03-31 10:45:41 -07:00
commit 457c48ec71
7 changed files with 24 additions and 6 deletions

View File

@ -63,7 +63,7 @@ int guacd_conf_parse_args(guacd_config* config, int argc, char** argv) {
/* Validate and parse log level */
int level = guacd_parse_log_level(optarg);
if (level == -1) {
fprintf(stderr, "Invalid log level. Valid levels are: \"debug\", \"info\", \"warning\", and \"error\".\n");
fprintf(stderr, "Invalid log level. Valid levels are: \"trace\", \"debug\", \"info\", \"warning\", and \"error\".\n");
return 1;
}

View File

@ -78,7 +78,7 @@ static int guacd_conf_callback(const char* section, const char* param, const cha
/* Invalid log level */
if (level < 0) {
guacd_conf_parse_error = "Invalid log level. Valid levels are: \"debug\", \"info\", \"warning\", and \"error\".";
guacd_conf_parse_error = "Invalid log level. Valid levels are: \"trace\", \"debug\", \"info\", \"warning\", and \"error\".";
return 1;
}

View File

@ -527,6 +527,7 @@ int guacd_parse_log_level(const char* name) {
if (strcmp(name, "error") == 0) return GUAC_LOG_ERROR;
if (strcmp(name, "warning") == 0) return GUAC_LOG_WARNING;
if (strcmp(name, "debug") == 0) return GUAC_LOG_DEBUG;
if (strcmp(name, "trace") == 0) return GUAC_LOG_TRACE;
/* No such log level */
return -1;

View File

@ -72,6 +72,12 @@ void vguacd_log(guac_client_log_level level, const char* format,
priority_name = "DEBUG";
break;
/* Trace log level */
case GUAC_LOG_TRACE:
priority = LOG_DEBUG;
priority_name = "TRACE";
break;
/* Any unknown/undefined log level */
default:
priority = LOG_INFO;

View File

@ -66,6 +66,7 @@ Sets the maximum level at which
.B guacd
will log messages to syslog and, if running in the foreground, the console.
Legal values are
.B trace,
.B debug,
.B info,
.B warning,

View File

@ -109,6 +109,7 @@ Sets the maximum level at which
.B guacd
will log messages to syslog and, if running in the foreground, the console.
Legal values are
.B trace,
.B debug,
.B info,
.B warning,

View File

@ -56,8 +56,8 @@ typedef enum guac_client_state {
/**
* All supported log levels used by the logging subsystem of each Guacamole
* client. These log levels correspond to a subset of the log levels defined by
* RFC 5424.
* client. With the exception of GUAC_LOG_TRACE, these log levels correspond to
* a subset of the log levels defined by RFC 5424.
*/
typedef enum guac_client_log_level {
@ -78,9 +78,18 @@ typedef enum guac_client_log_level {
/**
* Informational messages which can be useful for debugging, but are
* otherwise not useful to users or administrators.
* otherwise not useful to users or administrators. It is expected that
* debug level messages, while verbose, will not negatively affect
* performance.
*/
GUAC_LOG_DEBUG = 7
GUAC_LOG_DEBUG = 7,
/**
* Informational messages which can be useful for debugging, like
* GUAC_LOG_DEBUG, but which are so low-level that they may affect
* performance.
*/
GUAC_LOG_TRACE = 8
} guac_client_log_level;