| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include "GaudiKernel/MsgStream.h"
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);
15 StreamLogger(IMessageSvc*, MSG::Level);
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;
29 MsgStream *p_msgStr;
30 MSG::Level m_level;
31 std::string m_name;
32 };
33
34
35 #endif