From 96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 3 May 2006 06:49:30 +0000 Subject: 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. --- src/test/log.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/test/log.cpp (limited to 'src/test') 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 @@ +#include +#include +#include +#include "multilog.h" +#include "multilogtext.h" + +void testlog( const char *text ); + +class Test +{ +public: + Test() + { + MultiLineLog( 4, "Test init'd\n"); + } +}; + +int main() +{ + MultiLog &xLog = MultiLog::getInstance(); + + xLog.LineLog( 2, "Hello again"); + + MultiLog::getInstance().addChannel( + new MultiLogText( STDOUT_FILENO, "%02y-%02m-%02d %02h:%02M:%02s: %t" ) + ); + + MultiLineLog( MultiLog::LError, "Hi there!"); + Test t; + + testlog("external test"); +} + -- cgit v1.2.3