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 /tests/logger | |
parent | 7919264493777c9cd849879a326d1e34746b13ea (diff) | |
download | crawler-ee62ba650e4d5cea8c9f48f9ed66826a413cd9e8.tar.gz crawler-ee62ba650e4d5cea8c9f48f9ed66826a413cd9e8.tar.bz2 |
-
Diffstat (limited to 'tests/logger')
-rw-r--r-- | tests/logger/test1.MUST | 11 | ||||
-rw-r--r-- | tests/logger/test1.cpp | 31 |
2 files changed, 41 insertions, 1 deletions
diff --git a/tests/logger/test1.MUST b/tests/logger/test1.MUST index 07252ef..d0f9c49 100644 --- a/tests/logger/test1.MUST +++ b/tests/logger/test1.MUST @@ -3,3 +3,14 @@ CRITICAL: critical error ERROR: error WARNING: warning NOTICE: notice +FATAL: fatal error +CRITICAL: critical error +ERROR: error +WARNING: warning +NOTICE: notice +INFO: info +DEBUG: debug +DEBUG1: debug level 1 +DEBUG2: debug level 2 +DEBUG3: debug level 3 +DEBUG4: debug level 4 diff --git a/tests/logger/test1.cpp b/tests/logger/test1.cpp index 0b1e11b..5940d60 100644 --- a/tests/logger/test1.cpp +++ b/tests/logger/test1.cpp @@ -4,7 +4,8 @@ int main( void ) { - Logger::instance( ).addSink( new ConsoleLogSink( logNOTICE ) ); + LogSink *sink = new ConsoleLogSink( logNOTICE ); + Logger::instance( ).addSink( sink ); Logger::instance( ).addSink( new FileLogSink( logNOTICE, "test1.log" ) ); LOG( logFATAL ) << "fatal error"; @@ -18,6 +19,34 @@ int main( void ) LOG( logDEBUG2 ) << "debug level 2"; LOG( logDEBUG3 ) << "debug level 3"; LOG( logDEBUG4 ) << "debug level 4"; + + sink->setReportingLevel( logDEBUG4 ); + + LOG( logFATAL ) << "fatal error"; + LOG( logCRITICAL ) << "critical error"; + LOG( logERROR ) << "error"; + LOG( logWARNING ) << "warning"; + LOG( logNOTICE ) << "notice"; + LOG( logINFO ) << "info"; + LOG( logDEBUG ) << "debug"; + LOG( logDEBUG1 ) << "debug level 1"; + LOG( logDEBUG2 ) << "debug level 2"; + LOG( logDEBUG3 ) << "debug level 3"; + LOG( logDEBUG4 ) << "debug level 4"; + + sink->setReportingLevel( logNONE ); + + LOG( logFATAL ) << "fatal error"; + LOG( logCRITICAL ) << "critical error"; + LOG( logERROR ) << "error"; + LOG( logWARNING ) << "warning"; + LOG( logNOTICE ) << "notice"; + LOG( logINFO ) << "info"; + LOG( logDEBUG ) << "debug"; + LOG( logDEBUG1 ) << "debug level 1"; + LOG( logDEBUG2 ) << "debug level 2"; + LOG( logDEBUG3 ) << "debug level 3"; + LOG( logDEBUG4 ) << "debug level 4"; return 0; } |