All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StreamLogger.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_STREAMLOGGER_H
2 #define GAUDISVC_STREAMLOGGER_H
3 
5 
6 #include <ostream>
7 #include <string>
8 
9 class IMessageSvc;
10 
11 class StreamLogger {
12 public:
13  StreamLogger(const std::string& file);
14  StreamLogger(std::ostream &ost);
16  // StreamLogger();
17  ~StreamLogger();
18 
19  std::string name() const;
20 
21  void WriteToStream(const std::string& str) { *p_ost << str << std::endl; }
22  void WriteToMsgSvc(const std::string& str) { *p_msgStr << m_level << str
23  << endmsg; }
24 
25 
26 private:
27  bool m_isMine;
28  std::ostream *p_ost;
31  std::string m_name;
32 };
33 
34 
35 #endif
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::ostream * p_ost
Definition: StreamLogger.h:28
StreamLogger(const std::string &file)
MsgStream * p_msgStr
Definition: StreamLogger.h:29
std::string m_name
Definition: StreamLogger.h:31
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:57
list file
Definition: ana.py:160
void WriteToMsgSvc(const std::string &str)
Definition: StreamLogger.h:22
std::string name() const
void WriteToStream(const std::string &str)
Definition: StreamLogger.h:21
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
MSG::Level m_level
Definition: StreamLogger.h:30