diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
commit | 43b355734cf192129f2906789185301a61f4cd8a (patch) | |
tree | 35a3a56a085fc590b1864347d49660d421157305 /src/log.h | |
parent | 43255a7f63af65d88bbead4c0d6429ef2008ada8 (diff) | |
download | mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.gz mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.xz mpd-43b355734cf192129f2906789185301a61f4cd8a.zip |
Add WARNING log method. it's the same as ERROR, except that when mpd starts,
warnings are buffered until the error log is opened, and then flushed to the
error log.
git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/log.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -28,6 +28,7 @@ #define LOG_LEVEL_DEBUG 2 extern int logLevel; +extern short warningFlushed; #define ERROR(...) myfprintf(stderr, __VA_ARGS__) @@ -40,7 +41,15 @@ extern int logLevel; #define DEBUG(...) if(logLevel>=LOG_LEVEL_DEBUG) \ myfprintf(stdout, __VA_ARGS__) +#define WARNING(...) { \ + if(warningFlushed) myfprintf(stderr, __VA_ARGS__); \ + else bufferWarning(__VA_ARGS__); \ +} + void initLog(); +void bufferWarning(char * format, ... ); + +void flushWarningLog(); + #endif -/* vim:set shiftwidth=4 tabstop=8 expandtab: */ |