diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-08-22 20:55:25 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-08-22 20:55:25 +0200 |
commit | ee62ba650e4d5cea8c9f48f9ed66826a413cd9e8 (patch) | |
tree | a7ce976107398add2563fcf78267c1a75d62012d /src | |
parent | 7919264493777c9cd849879a326d1e34746b13ea (diff) | |
download | crawler-ee62ba650e4d5cea8c9f48f9ed66826a413cd9e8.tar.gz crawler-ee62ba650e4d5cea8c9f48f9ed66826a413cd9e8.tar.bz2 |
-
Diffstat (limited to 'src')
-rwxr-xr-x | src/LogSink.hpp | 4 | ||||
-rw-r--r-- | src/Logger.cpp | 3 | ||||
-rwxr-xr-x | src/Logger.hpp | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/LogSink.hpp b/src/LogSink.hpp index 47d92a7..322e546 100755 --- a/src/LogSink.hpp +++ b/src/LogSink.hpp @@ -12,8 +12,8 @@ class LogSink virtual void log( const LogLevel level, const std::string &msg ) = 0; - protected: - + void setReportingLevel( const LogLevel level ) { m_level = level; } + LogLevel reportingLevel( ) { return m_level; } private: diff --git a/src/Logger.cpp b/src/Logger.cpp index 24957a8..01f528e 100644 --- a/src/Logger.cpp +++ b/src/Logger.cpp @@ -53,7 +53,7 @@ void Logger::log( const LogLevel level, const string &msg ) string Logger::toString( const LogLevel level ) { - static const char* const buf[] = { "FATAL", "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4" }; + static const char* const buf[] = { "NONE", "FATAL", "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4" }; return buf[level]; } @@ -70,6 +70,7 @@ LogLevel Logger::fromString( const string& level ) if( level == "ERROR" ) return logERROR; if( level == "CRITICAL" ) return logCRITICAL; if( level == "FATAL" ) return logFATAL; + if( level == "NONE" ) return logNONE; LOG( logWARNING ) << "Unknown log level '" << level << "'. Using INFO level as default."; return logINFO; diff --git a/src/Logger.hpp b/src/Logger.hpp index a004068..03e66ba 100755 --- a/src/Logger.hpp +++ b/src/Logger.hpp @@ -9,6 +9,7 @@ #include <list> enum LogLevel { + logNONE, logFATAL, logCRITICAL, logERROR, |