00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_LOG_AGGREGATOR_CONSOLE_H_
00028 #define CEYLAN_LOG_AGGREGATOR_CONSOLE_H_
00029
00030
00031 #include "CeylanLogAggregator.h"
00032 #include "CeylanDisplayable.h"
00033
00034 #include <iosfwd>
00035 #include <string>
00036
00037
00038
00039 namespace Ceylan
00040 {
00041
00042
00043 namespace System
00044 {
00045
00046
00047
00048 class File ;
00049
00050
00051 class Console ;
00052
00053
00054 }
00055
00056
00057 namespace Log
00058 {
00059
00060
00061
00062 class LogMessage ;
00063
00064
00079 class CEYLAN_DLL LogAggregatorConsole : public LogAggregator
00080 {
00081
00082
00083 public:
00084
00085
00097 enum StandardStream { Output, Error, Log } ;
00098
00099
00127 explicit LogAggregatorConsole(
00128 StandardStream consoleStream
00129 = LogAggregatorConsole::Output,
00130 bool immediateWrite = true,
00131 bool useGlobalLevelOfDetail = true,
00132 bool beSmart = true ) ;
00133
00134
00143 virtual ~LogAggregatorConsole() throw() ;
00144
00145
00156 virtual void aggregate() ;
00157
00158
00173 virtual void store( LogMessage & message ) ;
00174
00175
00188 virtual const std::string toString(
00189 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00190
00191
00192
00193
00194 protected:
00195
00196
00207 virtual void write( const LogChannel & channel ) const ;
00208
00209
00220 virtual void write( const LogMessage & message ) const ;
00221
00222
00224 StandardStream _streamNumber ;
00225
00226
00231 std::ostream * _outputStream ;
00232
00233
00239 System::Console * _console ;
00240
00241
00247 bool _immediateWrite ;
00248
00249
00257 bool _useGlobalLevelOfDetail ;
00258
00259
00265 LevelOfDetail _globalLevelOfDetail ;
00266
00267
00268
00269 private:
00270
00271
00280 LogAggregatorConsole( const LogAggregatorConsole & source ) ;
00281
00282
00291 LogAggregatorConsole & operator = (
00292 const LogAggregatorConsole & source ) ;
00293
00294
00295 } ;
00296
00297
00298 }
00299
00300
00301 }
00302
00303
00304 #endif // CEYLAN_LOG_AGGREGATOR_CONSOLE_H_
00305