log_ErrorStream Class Reference
[Error logging]

#include <errorlog.h>

Inheritance diagram for log_ErrorStream:

Inheritance graph
[legend]
Collaboration diagram for log_ErrorStream:

Collaboration graph
[legend]

List of all members.


Detailed Description

Stream to log errors.

Internal singleton.

Author:
Matej Kenda

Definition at line 33 of file errorlog.h.


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.

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 58 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.

00059     : log_File(g_cmn.dirs.log + g_cmn.c_ErrorFileName),
00060       m_broken(false) {
00061     IVD_COUT_LOG_m(" log_ErrorStream::log_ErrorStream() ")
00062 
00063     // Singleton check.
00064     if (m_created) {
00065         throw ivd_Error(ie_SINGLETON_EXISTS);
00066     }
00067     else {
00068         m_created = true;
00069     }
00070 
00071     int result = cmn_CreatePathNoException(cmn_Path(g_cmn.dirs.log));
00072 
00073     if (result != 0) {
00074         cout
00075             << "** CRITICAL: log path can't be created: " << g_cmn.dirs.log << endl
00076             << "Errors will not be logged." << endl
00077             << "Error: " << result;
00078     }
00079 }

Here is the call graph for this function:


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

Generated on Mon Feb 27 19:42:37 2012 for OPENARCHIVE by  doxygen 1.5.6