diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/log.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/log.cpp b/src/test/log.cpp new file mode 100644 index 0000000..0420e37 --- /dev/null +++ b/src/test/log.cpp | |||
@@ -0,0 +1,33 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <iostream> | ||
4 | #include "multilog.h" | ||
5 | #include "multilogtext.h" | ||
6 | |||
7 | void testlog( const char *text ); | ||
8 | |||
9 | class Test | ||
10 | { | ||
11 | public: | ||
12 | Test() | ||
13 | { | ||
14 | MultiLineLog( 4, "Test init'd\n"); | ||
15 | } | ||
16 | }; | ||
17 | |||
18 | int main() | ||
19 | { | ||
20 | MultiLog &xLog = MultiLog::getInstance(); | ||
21 | |||
22 | xLog.LineLog( 2, "Hello again"); | ||
23 | |||
24 | MultiLog::getInstance().addChannel( | ||
25 | new MultiLogText( STDOUT_FILENO, "%02y-%02m-%02d %02h:%02M:%02s: %t" ) | ||
26 | ); | ||
27 | |||
28 | MultiLineLog( MultiLog::LError, "Hi there!"); | ||
29 | Test t; | ||
30 | |||
31 | testlog("external test"); | ||
32 | } | ||
33 | |||