diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-04-15 10:01:01 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-04-15 10:01:01 +0200 |
commit | 9642447fb0c7d10e06452d0d153a1a00d7f60a65 (patch) | |
tree | 3abe3d881d7fa5a2046f2fbb87cbdf03bec6a636 /src/Log.cpp | |
parent | ee0db2ebbc3e0e9d6a50e8ab3fd108d903afed2a (diff) | |
download | dabmux-9642447fb0c7d10e06452d0d153a1a00d7f60a65.tar.gz dabmux-9642447fb0c7d10e06452d0d153a1a00d7f60a65.tar.bz2 dabmux-9642447fb0c7d10e06452d0d153a1a00d7f60a65.zip |
Add discard level to Log
Diffstat (limited to 'src/Log.cpp')
-rw-r--r-- | src/Log.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Log.cpp b/src/Log.cpp index 75380dd..35f3fae 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -38,6 +38,10 @@ void Logger::register_backend(LogBackend* backend) { void Logger::log(log_level_t level, const char* fmt, ...) { + if (level == discard) { + return; + } + int size = 100; std::string str; va_list ap; @@ -61,6 +65,10 @@ void Logger::log(log_level_t level, const char* fmt, ...) void Logger::logstr(log_level_t level, std::string message) { + if (level == discard) { + return; + } + /* Remove a potential trailing newline. * It doesn't look good in syslog */ |