| The Gaudi Framework v28r2-patches (bc4ad17a)

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

- File List
- File Members

StreamLogger.cpp
Go to the documentation of this file.
1 #include "StreamLogger.h"
2 #include <fstream>
3
4 StreamLogger::StreamLogger(const std::string& file)
5 : m_name{ "file:" + file },
6 m_oost{ new std::ofstream(file) }, m_ost{ m_oost.get() }
7 {
8 if (!m_oost) throw std::invalid_argument("can't open file");
9 }
10
11 StreamLogger::StreamLogger(IMessageSvc *svc, MSG::Level lev):
12 m_name{ "MsgStream" },
13 m_msgStr{ new MsgStream( svc, "IssueLogger") },
14 m_level{ lev }
15 { }
16
17 StreamLogger::StreamLogger(std::ostream& ost):
18 m_name{ &ost == &std::cerr ? "STDERR" :
19 &ost == &std::cout ? "STDOUT" :
20 "unknown ostream" },
21 m_ost{ &ost }
22 { }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StreamLogger::m_msgStr
std::unique_ptr< MsgStream > m_msgStr
Definition: StreamLogger.h:26
StreamLogger::StreamLogger
StreamLogger(const std::string &file)
Definition: StreamLogger.cpp:4
StreamLogger::m_name
std::string m_name
Definition: StreamLogger.h:23
std::string
STL class.
MSG::Level
Level
Definition: IMessageSvc.h:15
std::ofstream
STL class.
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:57
std::unique_ptr::get
T get(T...args)
StreamLogger.h
StreamLogger::m_oost
std::unique_ptr< std::ostream > m_oost
Definition: StreamLogger.h:24
std::ostream
STL class.
std::invalid_argument
STL class.
StreamLogger::m_level
MSG::Level m_level
Definition: StreamLogger.h:27
StreamLogger::m_ost
std::ostream * m_ost
Definition: StreamLogger.h:25