loggingoutput.cpp

Go to the documentation of this file.
00001 
00002 /***************************************************************************
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU General Public License as published by  *
00006  *   the Free Software Foundation; either version 2 of the License, or     *
00007  *   (at your option) any later version.                                   *
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 

Generated on Mon May 21 01:26:34 2012 for Advanced Strategic Command by  doxygen 1.5.1