Commit 16b5ccd8a1fec82caf0d1d02331e3da332b55116
1 parent
837d281d
minor changes
Showing
3 changed files
with
23 additions
and
22 deletions
src/log.cpp
@@ -20,13 +20,6 @@ | @@ -20,13 +20,6 @@ | ||
20 | * DEALINGS IN THE SOFTWARE. * | 20 | * DEALINGS IN THE SOFTWARE. * |
21 | * ***************************************************************************/ | 21 | * ***************************************************************************/ |
22 | 22 | ||
23 | -// std | ||
24 | -#include <ios> | ||
25 | -#include <iomanip> | ||
26 | -#include <iostream> | ||
27 | -#include <sstream> | ||
28 | -#include <thread> | ||
29 | - | ||
30 | #include "log.h" | 23 | #include "log.h" |
31 | #include "threadcontext.h" | 24 | #include "threadcontext.h" |
32 | 25 | ||
@@ -118,10 +111,6 @@ std::string Log::fileinfoMessage( const char* file, int line, const std::string& | @@ -118,10 +111,6 @@ std::string Log::fileinfoMessage( const char* file, int line, const std::string& | ||
118 | (void)file; | 111 | (void)file; |
119 | (void)line; | 112 | (void)line; |
120 | 113 | ||
121 | -// static const std::string templ("%1:%2| %3"); | ||
122 | -// QFileInfo fi(file); | ||
123 | -// return templ.arg( fi.fileName() ).arg(line).arg(message); | ||
124 | - | ||
125 | return message; | 114 | return message; |
126 | } | 115 | } |
127 | 116 |
src/log.h
tests/logtest.cpp
@@ -7,19 +7,32 @@ LogTest::LogTest() | @@ -7,19 +7,32 @@ LogTest::LogTest() | ||
7 | 7 | ||
8 | void LogTest::writeTest() | 8 | void LogTest::writeTest() |
9 | { | 9 | { |
10 | + osdev::components::log::Log::setMask( osdev::components::log::LogMask::None ); | ||
11 | + | ||
12 | + | ||
13 | + LogDebug ( "testing the debug message", "test_debug" ); | ||
14 | + LogInfo ( "testing the info message", "test_info" ); | ||
15 | + LogNotice ( "testing the notice message", "test_notice" ); | ||
16 | + LogWarning ( "testing the warning message", "test_warning" ); | ||
17 | + LogError ( "testing the error message", "test_error" ); | ||
18 | + LogCritical ( "testing the critical message", "test_critical" ); | ||
19 | + LogAlert ( "testing the alert message", "test_alert" ); | ||
20 | + LogEmergency( "testing the emergency message", "test_emergency" ); | ||
21 | + | ||
10 | osdev::components::log::Log::setMask( osdev::components::log::LogMask::Upto ); | 22 | osdev::components::log::Log::setMask( osdev::components::log::LogMask::Upto ); |
23 | + osdev::components::log::Log::setLogLevel( osdev::components::log::LogLevel::Notice ); | ||
11 | 24 | ||
12 | - LogError ( "testcase", "testing the error message" ); | ||
13 | - LogCritical ( "testcase", "testing the critical message" ); | ||
14 | - LogAlert ( "testcase", "testing the alert message" ); | ||
15 | - LogEmergency( "testcase", "testing the emergency message" ); | 25 | + LogDebug ( "testing the debug message", "test_debug" ); |
26 | + LogInfo ( "testing the info message", "test_info" ); | ||
27 | + LogNotice ( "testing the notice message", "test_notice" ); | ||
28 | + LogWarning ( "testing the warning message", "test_warning" ); | ||
16 | 29 | ||
17 | - osdev::components::log::Log::setMask( osdev::components::log::LogMask::None ); | 30 | + osdev::components::log::Log::setMask( osdev::components::log::LogMask::Mask ); |
31 | + osdev::components::log::Log::setLogLevel( osdev::components::log::LogLevel::Notice ); | ||
18 | 32 | ||
19 | - LogDebug ( "testcase", "testing the debug message" ); | ||
20 | - LogDebug ( "testcase", "testing a second debug message" ); | ||
21 | - LogInfo ( "testcase", "testing the info message" ); | ||
22 | - LogNotice ( "testcase", "testing the notice message" ); | ||
23 | - LogWarning ( "testcase", "testing the warning message" ); | 33 | + LogDebug ( "testing the debug message", "test_debug" ); |
34 | + LogInfo ( "testing the info message", "test_info" ); | ||
35 | + LogNotice ( "testing the notice message", "test_notice" ); | ||
36 | + LogWarning ( "testing the warning message", "test_warning" ); | ||
24 | 37 | ||
25 | } | 38 | } |