aboutsummaryrefslogtreecommitdiffstats
path: root/src/log.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-28 05:14:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-28 05:14:55 +0000
commit58dbe4bb5d974c34335d6906a9ce930f07cd1db4 (patch)
tree9a6aee08b21100cb74e809f0620d81466f6067df /src/log.c
parent8f40569aeeafe4a36e3d719c1df97de42606ea76 (diff)
downloadmpd-58dbe4bb5d974c34335d6906a9ce930f07cd1db4.tar.gz
mpd-58dbe4bb5d974c34335d6906a9ce930f07cd1db4.tar.xz
mpd-58dbe4bb5d974c34335d6906a9ce930f07cd1db4.zip
merge shank-rewrite-config changes
git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/log.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/log.c b/src/log.c
index 835fa9e00..964b8aa66 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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