Public Member Functions | Private Attributes | Static Private Attributes

log_ErrorStream Class Reference
[Error logging]

Stream to log errors. More...

#include <errorlog.h>

Inheritance diagram for log_ErrorStream:
Inheritance graph
[legend]
Collaboration diagram for log_ErrorStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 log_ErrorStream ()
virtual ~log_ErrorStream ()
int SetNewPath (void)
bool IsBroken () const
string GetHeader () const

Private Attributes

bool m_broken

Static Private Attributes

static bool m_created = false
 Flag to guarantee singleton.

Detailed Description

Stream to log errors.

Internal singleton.

Author:
Matej Kenda

Definition at line 47 of file errorlog.h.


Constructor & Destructor Documentation

log_ErrorStream::log_ErrorStream (  ) 
Exceptions:
ivd_Error(ie_SINGLETON_EXISTS,"",true) 
ivd_SysError(errno,Trying to get ivd_STAT of log file.,true); 
Warning:
DO NOT USE SYSINFO IN THIS CONSTRUCTOR.

Definition at line 72 of file log_errorlog.cpp.

References cmn_CreatePathNoException(), cmn_Global::dirs, g_cmn, ie_SINGLETON_EXISTS, IVD_COUT_LOG_m, ivd_Error, ivd_Directories::log, and m_created.

    : log_File(g_cmn.dirs.log + g_cmn.c_ErrorFileName),
      m_broken(false) {
    IVD_COUT_LOG_m(" log_ErrorStream::log_ErrorStream() ")

    // Singleton check.
    if (m_created) {
        throw ivd_Error(ie_SINGLETON_EXISTS);
    }
    else {
        m_created = true;
    }

    int result = cmn_CreatePathNoException(cmn_Path(g_cmn.dirs.log));

    if (result != 0) {
        cout
            << "** CRITICAL: log path can't be created: " << g_cmn.dirs.log << endl
            << "Errors will not be logged." << endl
            << "Error: " << result;
    }
}

Here is the call graph for this function:


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