Repository: incubator-guacamole-server Updated Branches: refs/heads/master aba2b46a7 -> 457c48ec7
GUACAMOLE-259: Add TRACE log level. Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/e910dcbf Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/e910dcbf Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/e910dcbf Branch: refs/heads/master Commit: e910dcbfcc436b527c0217e5ce5b5e1b9b0d48d7 Parents: 039a1c5 Author: Michael Jumper <[email protected]> Authored: Wed Mar 29 22:32:01 2017 -0700 Committer: Michael Jumper <[email protected]> Committed: Thu Mar 30 01:15:51 2017 -0700 ---------------------------------------------------------------------- src/guacd/conf-args.c | 2 +- src/guacd/conf-file.c | 2 +- src/guacd/conf-parse.c | 1 + src/guacd/log.c | 6 ++++++ src/guacd/man/guacd.8 | 1 + src/guacd/man/guacd.conf.5 | 1 + src/libguac/guacamole/client-types.h | 17 +++++++++++++---- 7 files changed, 24 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/conf-args.c ---------------------------------------------------------------------- diff --git a/src/guacd/conf-args.c b/src/guacd/conf-args.c index 54551df..448f84d 100644 --- a/src/guacd/conf-args.c +++ b/src/guacd/conf-args.c @@ -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; } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/conf-file.c ---------------------------------------------------------------------- diff --git a/src/guacd/conf-file.c b/src/guacd/conf-file.c index 760f24f..ba32c78 100644 --- a/src/guacd/conf-file.c +++ b/src/guacd/conf-file.c @@ -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; } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/conf-parse.c ---------------------------------------------------------------------- diff --git a/src/guacd/conf-parse.c b/src/guacd/conf-parse.c index b418101..e5a034f 100644 --- a/src/guacd/conf-parse.c +++ b/src/guacd/conf-parse.c @@ -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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/log.c ---------------------------------------------------------------------- diff --git a/src/guacd/log.c b/src/guacd/log.c index 121bb69..c99a5ed 100644 --- a/src/guacd/log.c +++ b/src/guacd/log.c @@ -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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/man/guacd.8 ---------------------------------------------------------------------- diff --git a/src/guacd/man/guacd.8 b/src/guacd/man/guacd.8 index afdf667..c68af36 100644 --- a/src/guacd/man/guacd.8 +++ b/src/guacd/man/guacd.8 @@ -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, http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/guacd/man/guacd.conf.5 ---------------------------------------------------------------------- diff --git a/src/guacd/man/guacd.conf.5 b/src/guacd/man/guacd.conf.5 index eacd52c..4605f7d 100644 --- a/src/guacd/man/guacd.conf.5 +++ b/src/guacd/man/guacd.conf.5 @@ -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, http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e910dcbf/src/libguac/guacamole/client-types.h ---------------------------------------------------------------------- diff --git a/src/libguac/guacamole/client-types.h b/src/libguac/guacamole/client-types.h index 636ac9b..1caa6bc 100644 --- a/src/libguac/guacamole/client-types.h +++ b/src/libguac/guacamole/client-types.h @@ -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;
