summaryrefslogtreecommitdiff
path: root/src/test/log.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-05-03 06:49:30 +0000
committerMike Buland <eichlan@xagasoft.com>2006-05-03 06:49:30 +0000
commit96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75 (patch)
treea930fe51f01a7400fe97b46db2fcfcdc1f2712da /src/test/log.cpp
parent33fef4a17290e7872293d8cc173bec826f24001c (diff)
downloadlibbu++-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.cpp33
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
7void testlog( const char *text );
8
9class Test
10{
11public:
12 Test()
13 {
14 MultiLineLog( 4, "Test init'd\n");
15 }
16};
17
18int 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