00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013
00014 #include "loggingoutput.h"
00015 #include "util/messaginghub.h"
00016 #include "basestrm.h"
00017
00018
00019 void LoggingOutputHandler::messageLogger( const ASCString& msg, int level )
00020 {
00021 logfile << msg << std::flush;
00022 }
00023
00024 ASCString LoggingOutputHandler::getFilename( const ASCString& path )
00025 {
00026 ASCString p = path;
00027 appendbackslash ( p );
00028 p += "log.txt";
00029 return p;
00030 }
00031
00032
00033 LoggingOutputHandler::LoggingOutputHandler( const ASCString& path )
00034 : filename( getFilename( path )), logfile( filename.c_str() )
00035 {
00036 MessagingHub::Instance().logMessage.connect( SigC::slot( *this, &LoggingOutputHandler::messageLogger ));
00037 }
00038
00039
00040
00041