| The Gaudi Framework v29r1 (5cd95fa2)

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
StreamLogger Class Referencefinal

`#include <src/StreamLogger.h>`

Collaboration diagram for StreamLogger:
[legend]

## Public Member Functions
| StreamLogger (const std::string &file)
| StreamLogger (std::ostream &ost)
| StreamLogger (IMessageSvc *, MSG::Level)
const std::string & | name () const
void | WriteToStream (const std::string &str)
void | WriteToMsgSvc (const std::string &str)

## Private Attributes
std::string | m_name
std::unique_ptr< std::ostream > | m_oost
std::ostream * | m_ost = nullptr
std::unique_ptr< MsgStream > | m_msgStr
MSG::Level | m_level = MSG::NIL

## Detailed Description

Definition at line 11 of file StreamLogger.h.

## Constructor & Destructor Documentation

StreamLogger::StreamLogger | ( | const std::string & | file | ) |

Definition at line 4 of file StreamLogger.cpp.

5 : m_name{"file:" + file}, m_oost{new std::ofstream( file )}, m_ost{m_oost.get()}
6 {
7 if ( !m_oost ) throw std::invalid_argument( "can't open file" );
8 }
StreamLogger::m_name
std::string m_name
Definition: StreamLogger.h:24
std::ofstream
STL class.
std::unique_ptr::get
T get(T...args)
StreamLogger::m_oost
std::unique_ptr< std::ostream > m_oost
Definition: StreamLogger.h:25
std::invalid_argument
STL class.
StreamLogger::m_ost
std::ostream * m_ost
Definition: StreamLogger.h:26

StreamLogger::StreamLogger | ( | std::ostream & | ost | ) |

Definition at line 15 of file StreamLogger.cpp.

16 : m_name{&ost == &std::cerr ? "STDERR" : &ost == &std::cout ? "STDOUT" : "unknown ostream"}, m_ost{&ost}
17 {
18 }
StreamLogger::m_name
std::string m_name
Definition: StreamLogger.h:24
std::cerr
StreamLogger::m_ost
std::ostream * m_ost
Definition: StreamLogger.h:26

StreamLogger::StreamLogger | ( | IMessageSvc * | svc,
|  | MSG::Level | lev
| ) |  |

Definition at line 10 of file StreamLogger.cpp.

11 : m_name{"MsgStream"}, m_msgStr{new MsgStream( svc, "IssueLogger" )}, m_level{lev}
12 {
13 }
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:27
StreamLogger::m_name
std::string m_name
Definition: StreamLogger.h:24
StreamLogger::m_level
MSG::Level m_level
Definition: StreamLogger.h:28

## Member Function Documentation

const std::string& StreamLogger::name | ( |  | ) | const
| inline

Definition at line 18 of file StreamLogger.h.

18 { return m_name; }
StreamLogger::m_name
std::string m_name
Definition: StreamLogger.h:24

void StreamLogger::WriteToMsgSvc | ( | const std::string & | str | ) |
| inline

Definition at line 21 of file StreamLogger.h.

21 { *m_msgStr << m_level << str << endmsg; }
StreamLogger::m_msgStr
std::unique_ptr< MsgStream > m_msgStr
Definition: StreamLogger.h:27
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StreamLogger::m_level
MSG::Level m_level
Definition: StreamLogger.h:28

void StreamLogger::WriteToStream | ( | const std::string & | str | ) |
| inline

Definition at line 20 of file StreamLogger.h.

20 { *m_ost << str << std::endl; }
std::endl
T endl(T...args)
StreamLogger::m_ost
std::ostream * m_ost
Definition: StreamLogger.h:26

## Member Data Documentation

MSG::Level StreamLogger::m_level = MSG::NIL
| private

Definition at line 28 of file StreamLogger.h.

std::unique_ptr<MsgStream> StreamLogger::m_msgStr
| private

Definition at line 27 of file StreamLogger.h.

std::string StreamLogger::m_name
| private

Definition at line 24 of file StreamLogger.h.

std::unique_ptr<std::ostream> StreamLogger::m_oost
| private

Definition at line 25 of file StreamLogger.h.

std::ostream* StreamLogger::m_ost = nullptr
| private

Definition at line 26 of file StreamLogger.h.

The documentation for this class was generated from the following files:

- GaudiMonitor/src/StreamLogger.h
- GaudiMonitor/src/StreamLogger.cpp