diff --git a/src/log.cpp b/src/log.cpp index f0a0ce9..cf80a58 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -20,13 +20,6 @@ * DEALINGS IN THE SOFTWARE. * * ***************************************************************************/ -// std -#include -#include -#include -#include -#include - #include "log.h" #include "threadcontext.h" @@ -118,10 +111,6 @@ std::string Log::fileinfoMessage( const char* file, int line, const std::string& (void)file; (void)line; -// static const std::string templ("%1:%2| %3"); -// QFileInfo fi(file); -// return templ.arg( fi.fileName() ).arg(line).arg(message); - return message; } diff --git a/src/log.h b/src/log.h index 16b2b7e..31e84a5 100644 --- a/src/log.h +++ b/src/log.h @@ -22,7 +22,6 @@ #pragma once #include -#include #include namespace osdev { diff --git a/tests/logtest.cpp b/tests/logtest.cpp index 897f1e7..cd82d97 100644 --- a/tests/logtest.cpp +++ b/tests/logtest.cpp @@ -7,19 +7,32 @@ LogTest::LogTest() void LogTest::writeTest() { + osdev::components::log::Log::setMask( osdev::components::log::LogMask::None ); + + + LogDebug ( "testing the debug message", "test_debug" ); + LogInfo ( "testing the info message", "test_info" ); + LogNotice ( "testing the notice message", "test_notice" ); + LogWarning ( "testing the warning message", "test_warning" ); + LogError ( "testing the error message", "test_error" ); + LogCritical ( "testing the critical message", "test_critical" ); + LogAlert ( "testing the alert message", "test_alert" ); + LogEmergency( "testing the emergency message", "test_emergency" ); + osdev::components::log::Log::setMask( osdev::components::log::LogMask::Upto ); + osdev::components::log::Log::setLogLevel( osdev::components::log::LogLevel::Notice ); - LogError ( "testcase", "testing the error message" ); - LogCritical ( "testcase", "testing the critical message" ); - LogAlert ( "testcase", "testing the alert message" ); - LogEmergency( "testcase", "testing the emergency message" ); + LogDebug ( "testing the debug message", "test_debug" ); + LogInfo ( "testing the info message", "test_info" ); + LogNotice ( "testing the notice message", "test_notice" ); + LogWarning ( "testing the warning message", "test_warning" ); - osdev::components::log::Log::setMask( osdev::components::log::LogMask::None ); + osdev::components::log::Log::setMask( osdev::components::log::LogMask::Mask ); + osdev::components::log::Log::setLogLevel( osdev::components::log::LogLevel::Notice ); - LogDebug ( "testcase", "testing the debug message" ); - LogDebug ( "testcase", "testing a second debug message" ); - LogInfo ( "testcase", "testing the info message" ); - LogNotice ( "testcase", "testing the notice message" ); - LogWarning ( "testcase", "testing the warning message" ); + LogDebug ( "testing the debug message", "test_debug" ); + LogInfo ( "testing the info message", "test_info" ); + LogNotice ( "testing the notice message", "test_notice" ); + LogWarning ( "testing the warning message", "test_warning" ); }