diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-05-03 06:49:30 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-03 06:49:30 +0000 |
commit | 96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75 (patch) | |
tree | a930fe51f01a7400fe97b46db2fcfcdc1f2712da /src/test/log.cpp | |
parent | 33fef4a17290e7872293d8cc173bec826f24001c (diff) | |
download | libbu++-96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75.tar.gz libbu++-96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75.tar.bz2 libbu++-96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75.tar.xz libbu++-96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75.zip |
Added a simple test for the log system, and switched the multilog to the new
singleton system, which unfortunately changed it's API slightly. Now it's not
a pointer from the singleton, but I did add a new macro to make most usage of it
even easier.
Diffstat (limited to 'src/test/log.cpp')
-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 | |||