| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# StreamLogger.h

Go to the documentation of this file.

    00001 #ifndef GAUDISVC_STREAMLOGGER_H
    00002 #define GAUDISVC_STREAMLOGGER_H
    00003
    00004 #include "GaudiKernel/MsgStream.h"
    00005
    00006 #include <ostream>
    00007 #include <string>
    00008
    00009 class IMessageSvc;
    00010
    00011 class StreamLogger {
    00012 public:
    00013   StreamLogger(const std::string& file);
    00014   StreamLogger(std::ostream &ost);
    00015   StreamLogger(IMessageSvc*, MSG::Level);
    00016   //  StreamLogger();
    00017   ~StreamLogger();
    00018
    00019   std::string name() const;
    00020
    00021   void WriteToStream(const std::string& str) { *p_ost << str << std::endl; }
    00022   void WriteToMsgSvc(const std::string& str) { *p_msgStr << m_level << str
    00023                                                          << endmsg; }
    00024
    00025
    00026 private:
    00027   bool m_isMine;
    00028   std::ostream *p_ost;
    00029   MsgStream *p_msgStr;
    00030   MSG::Level m_level;
    00031   std::string m_name;
    00032 };
    00033
    00034
    00035 #endif