diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-28 04:51:46 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-28 04:51:46 +0000 |
commit | d0532eaf703396e838aa7dba77f58e296f503af5 (patch) | |
tree | c098d313db0e02d9c957565ce6336465c1d13f50 /src/log.c | |
parent | fa6f95685b8311be52e32aebc4ac86e8470b1fa3 (diff) | |
download | mpd-d0532eaf703396e838aa7dba77f58e296f503af5.tar.gz mpd-d0532eaf703396e838aa7dba77f58e296f503af5.tar.xz mpd-d0532eaf703396e838aa7dba77f58e296f503af5.zip |
new config file format stuff, quick test shows it works
git-svn-id: https://svn.musicpd.org/mpd/branches/shank-rewrite-config@2373 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -32,16 +32,24 @@ short warningFlushed = 0; static char * warningBuffer = NULL; void initLog() { - if(strcmp(getConf()[CONF_LOG_LEVEL],"default")==0) { + ConfigParam * param = getConfigParam(CONF_LOG_LEVEL); + + if(!param) return; + + if(0 == strcmp(param->value, "default")) { if(logLevel<LOG_LEVEL_LOW) logLevel = LOG_LEVEL_LOW; } - else if(strcmp(getConf()[CONF_LOG_LEVEL],"secure")==0) { + else if(0 == strcmp(param->value, "secure")) { if(logLevel<LOG_LEVEL_SECURE) logLevel = LOG_LEVEL_SECURE; } - else if(strcmp(getConf()[CONF_LOG_LEVEL],"verbose")==0) { + else if(0 == strcmp(param->value, "verbose")) { if(logLevel<LOG_LEVEL_DEBUG) logLevel = LOG_LEVEL_DEBUG; } - else ERROR("unknown log level \"%s\"\n",getConf()[CONF_LOG_LEVEL]); + else { + ERROR("unknown log level \"%s\" at line %i\n", + param->value, param->line); + exit(EXIT_FAILURE); + } } #define BUFFER_LENGTH 4096 |