GUAC-911: Reduce available log levels to ERROR, WARNING, INFO, and DEBUG.

This commit is contained in:
Michael Jumper 2014-11-08 20:19:12 -08:00
parent 431fd2de6f
commit f71067b024
3 changed files with 8 additions and 53 deletions

View File

@ -46,24 +46,6 @@ void vguacd_log(guac_client_log_level level, const char* format,
/* Convert log level to syslog priority */ /* Convert log level to syslog priority */
switch (level) { switch (level) {
/* Emergency log level */
case GUAC_LOG_EMERGENCY:
priority = LOG_EMERG;
priority_name = "EMERGENCY";
break;
/* Alert log level */
case GUAC_LOG_ALERT:
priority = LOG_ALERT;
priority_name = "ALERT";
break;
/* Critical log level */
case GUAC_LOG_CRITICAL:
priority = LOG_CRIT;
priority_name = "CRITICAL";
break;
/* Error log level */ /* Error log level */
case GUAC_LOG_ERROR: case GUAC_LOG_ERROR:
priority = LOG_ERR; priority = LOG_ERR;
@ -76,12 +58,6 @@ void vguacd_log(guac_client_log_level level, const char* format,
priority_name = "WARNING"; priority_name = "WARNING";
break; break;
/* Notice log level */
case GUAC_LOG_NOTICE:
priority = LOG_NOTICE;
priority_name = "NOTICE";
break;
/* Informational log level */ /* Informational log level */
case GUAC_LOG_INFO: case GUAC_LOG_INFO:
priority = LOG_INFO; priority = LOG_INFO;

View File

@ -320,7 +320,7 @@ int __guac_handle_end(guac_client* client, guac_instruction* instruction) {
} }
int __guac_handle_disconnect(guac_client* client, guac_instruction* instruction) { int __guac_handle_disconnect(guac_client* client, guac_instruction* instruction) {
guac_client_log(client, GUAC_LOG_NOTICE, guac_client_log(client, GUAC_LOG_INFO,
"Disconnect requested. Stopping client..."); "Disconnect requested. Stopping client...");
guac_client_stop(client); guac_client_stop(client);
return 0; return 0;

View File

@ -59,50 +59,29 @@ typedef enum guac_client_state {
/** /**
* All supported log levels used by the logging subsystem of each Guacamole * All supported log levels used by the logging subsystem of each Guacamole
* client. These log levels correspond to the log levels defined by RFC 5424. * client. These log levels correspond to a subset of the log levels defined by
* RFC 5424.
*/ */
typedef enum guac_client_log_level { typedef enum guac_client_log_level {
/** /**
* Emergencies which render the system unusable. * Fatal errors.
*/
GUAC_LOG_EMERGENCY = 0,
/**
* The system may be usable, but the current state is dangerous enough that
* action must be taken immediately.
*/
GUAC_LOG_ALERT = 1,
/**
* Critically-important messages.
*/
GUAC_LOG_CRITICAL = 2,
/**
* General errors: important, but not necessarily critically so.
*/ */
GUAC_LOG_ERROR = 3, GUAC_LOG_ERROR = 3,
/** /**
* Non-fatal conditions that are likely unintentional. * Non-fatal conditions that indicate problems.
*/ */
GUAC_LOG_WARNING = 4, GUAC_LOG_WARNING = 4,
/** /**
* Significant but normal conditions. * Informational messages of general interest to users or administrators.
*/
GUAC_LOG_NOTICE = 5,
/**
* Normal conditions that may be interesting but in most cases should be
* ignored.
*/ */
GUAC_LOG_INFO = 6, GUAC_LOG_INFO = 6,
/** /**
* Informational messages that are too frequent or too detailed for a more * Informational messages which can be useful for debugging, but are
* severe log level, but can be useful for debugging. * otherwise not useful to users or administrators.
*/ */
GUAC_LOG_DEBUG = 7 GUAC_LOG_DEBUG = 7