| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# StreamLogger Class Reference

`#include <StreamLogger.h>`

Collaboration diagram for StreamLogger:

[legend]

List of all members.

## Detailed Description

Definition at line 11 of file StreamLogger.h.

## Public Member Functions
| StreamLogger (const std::string &file)
| StreamLogger (std::ostream &ost)
| StreamLogger (IMessageSvc *, MSG::Level)
| ~StreamLogger ()
std::string | name () const
void | WriteToStream (const std::string &str)
void | WriteToMsgSvc (const std::string &str)
## Private Attributes
bool | m_isMine
std::ostream * | p_ost
MsgStream * | p_msgStr
MSG::Level | m_level
std::string | m_name

## Constructor & Destructor Documentation

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

Definition at line 11 of file StreamLogger.cpp.

    00011                                                : m_isMine(1),
    00012                                                      p_ost(0), p_msgStr(0) {
    00013   m_name = "file:" + file;
    00014   p_ost = new std::ofstream(file.c_str());
    00015   if (p_ost == 0) {
    00016     throw std::invalid_argument("can't open file");
    00017   }
    00018 }

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

Definition at line 27 of file StreamLogger.cpp.

    00027                                          : m_isMine(0) , p_ost(0),
    00028                                                p_msgStr(0){
    00029   p_ost = &ost;
    00030   if (ost == std::cerr) {
    00031     m_name = "STDERR";
    00032   } else if ( ost == std::cout) {
    00033     m_name = "STDOUT";
    00034   } else {
    00035     m_name = "unknown ostream";
    00036   }
    00037 }

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

Definition at line 20 of file StreamLogger.cpp.

    00020                                                         :
    00021   m_isMine(1), p_ost(0), p_msgStr(0) {
    00022   p_msgStr = new MsgStream( svc, "IssueLogger");
    00023   m_level = lev;
    00024   m_name = "MsgStream";
    00025 }

StreamLogger::~StreamLogger | ( |  | ) |

Definition at line 44 of file StreamLogger.cpp.

    00044                             {
    00045   if (m_isMine && p_ost != 0) {
    00046     delete p_ost;
    00047   }
    00048   if (p_msgStr != 0) {
    00049     delete p_msgStr;
    00050   }
    00051 }

## Member Function Documentation

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

Definition at line 40 of file StreamLogger.cpp.

    00040                          {
    00041   return m_name;
    00042 }

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

Definition at line 21 of file StreamLogger.h.

    00021 { *p_ost << str << std::endl; }

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

Definition at line 22 of file StreamLogger.h.

    00022                                            { *p_msgStr << m_level << str
    00023                                                          << endreq; }

## Member Data Documentation

bool StreamLogger::m_isMine`[private]`

Definition at line 27 of file StreamLogger.h.

std::ostream* StreamLogger::p_ost`[private]`

Definition at line 28 of file StreamLogger.h.

MsgStream* StreamLogger::p_msgStr`[private]`

Definition at line 29 of file StreamLogger.h.

MSG::Level StreamLogger::m_level`[private]`

Definition at line 30 of file StreamLogger.h.

std::string StreamLogger::m_name`[private]`

Definition at line 31 of file StreamLogger.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r4/GaudiSvc/src/IssueLogger/StreamLogger.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r4/GaudiSvc/src/IssueLogger/StreamLogger.cpp