summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-07-08 01:47:31 +0000
committerPavel Roskin <plroskin@gmail.com>2016-07-08 04:29:57 +0000
commit2c13ef5c6dd90ee2dcbcba282b2ee702e2ee9f84 (patch)
tree93829ae428c1930e1163b4798b18f908763db013
parent0c72ee237192b8e7e73070b6ec9273666b997d26 (diff)
downloadxrdp-proprietary-2c13ef5c6dd90ee2dcbcba282b2ee702e2ee9f84.tar.gz
xrdp-proprietary-2c13ef5c6dd90ee2dcbcba282b2ee702e2ee9f84.zip
Use enum logLevels consistently for log levels
-rw-r--r--common/log.h4
-rw-r--r--sesman/chansrv/chansrv.c10
-rw-r--r--sesman/tools/sestest.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/common/log.h b/common/log.h
index b90ac660..61a05d9c 100644
--- a/common/log.h
+++ b/common/log.h
@@ -68,9 +68,9 @@ struct log_config
const char *program_name;
char *log_file;
int fd;
- unsigned int log_level;
+ enum logLevels log_level;
int enable_syslog;
- unsigned int syslog_level;
+ enum logLevels syslog_level;
pthread_mutex_t log_lock;
pthread_mutexattr_t log_lock_attr;
};
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 0596b5ff..d272806c 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -1401,8 +1401,8 @@ get_log_path()
}
/*****************************************************************************/
-static unsigned int APP_CC
-get_log_level(const char* level_str, unsigned int default_level)
+static enum logLevels APP_CC
+get_log_level(const char* level_str, enum logLevels default_level)
{
static const char* levels[] = {
"LOG_LEVEL_ALWAYS",
@@ -1421,7 +1421,7 @@ get_log_level(const char* level_str, unsigned int default_level)
{
if (g_strcasecmp(levels[i], level_str) == 0)
{
- return i;
+ return (enum logLevels) i;
}
}
return default_level;
@@ -1466,7 +1466,7 @@ main(int argc, char **argv)
char log_file[256];
enum logReturns error;
struct log_config logconfig;
- unsigned int log_level;
+ enum logLevels log_level;
g_init("xrdp-chansrv"); /* os_calls */
@@ -1498,7 +1498,7 @@ main(int argc, char **argv)
logconfig.fd = -1;
logconfig.log_level = log_level;
logconfig.enable_syslog = 0;
- logconfig.syslog_level = 0;
+ logconfig.syslog_level = LOG_LEVEL_ALWAYS;
error = log_start_from_param(&logconfig);
if (error != LOG_STARTUP_OK)
diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c
index 17795dfc..081bc88b 100644
--- a/sesman/tools/sestest.c
+++ b/sesman/tools/sestest.c
@@ -44,7 +44,7 @@ int main(int argc, char **argv)
int sock;
log.enable_syslog = 0;
- log.log_level = 99;
+ log.log_level = LOG_LEVEL_DEBUG;
log.program_name = "sestest";
log.log_file = g_strdup("sestest.log");
log_start_from_param(&log);