35 fIsDeleteByCentralLog(isdelbycental)
57 std::string
tmp = name;
59 if ( tmp ==
"cout" ) {
60 fOutputStream = &std::cout;
62 if ( tmp ==
"cerr" ) {
63 fOutputStream = &std::cerr;
65 if ( tmp ==
"clog" ) {
66 fOutputStream = &std::clog;
68 if ( fOutputStream == 0x0 )
69 { fOutputStream =
new std::ofstream(
GetName().data(),std::ios_base::app) ; }
73 bool donot = fOutputStream == &std::cout || fOutputStream == &std::cerr || fOutputStream == &std::clog ;
75 if ( fOutputStream )
delete fOutputStream;
83 std::string message = alogmsg.
Message();
84 if ( message.size() < 1 )
87 if ( fOutputStream ) {
89 (*fOutputStream) << alogmsg.
Header();
91 (*fOutputStream) << message;
93 if ( message[message.size()-1] !=
'\n' )
95 (*fOutputStream) << alogmsg.
Footer();
98 fOutputStream->flush();
static LogCollector * theCollector()
return the current logcollector
virtual ELevel GetLevel() const
To get the current level of the message.
virtual ~OStreamCollector()
LogCollector(const char *, bool isdelbycental=false)
virtual std::string & GetName()
Base class for a Log collector.
OStreamCollector(const char *, bool isdelbycental=false)
virtual void DoCollect(LogMessage &)
write the message in a file
LogCollector * GetCurrentLogCollector() const
Return the current logcollector.
virtual std::string Message() const
To get the current message.
Base class for a Log message.
virtual std::string Header() const
To get the header of the current message.
header file for ADFLogMessage.cpp
ADF::LogMessage & endl(ADF::LogMessage &log)
unsigned short fMinLevel
to send to the log server only message having their level between min and max
virtual std::string Footer() const
To get the Footer of the current message.
static CentralLog * theCentralLog()
CentralLog is a singleton.