diff options
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 034976fb7..46a85da2c 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -77,7 +77,8 @@ void log(int level, char *text, ...) va_list argsPtr; char textbuffer[MAXBUF]; - if (level < Config->LogLevel) + /* If we were given -debug we output all messages, regardless of configured loglevel */ + if ((level < Config->LogLevel) && !Config->forcedebug) return; if (TIME != LAST) @@ -95,13 +96,13 @@ void log(int level, char *text, ...) vsnprintf(textbuffer, MAXBUF, text, argsPtr); va_end(argsPtr); - if (Config->log_file) + if (Config->writelog) fprintf(Config->log_file,"%s %s\n",TIMESTR,textbuffer); - - if (Config->nofork) - { - printf("%s %s\n", TIMESTR, textbuffer); - } + } + + if (Config->nofork) + { + printf("%s %s\n", TIMESTR, textbuffer); } } |