Public Member Functions | Private Attributes | Static Private Attributes

log_EventLog Class Reference
[Event logging]

A class to initialize event logging in each of the processes. More...

#include <eventlog.h>

List of all members.

Public Member Functions

 log_EventLog (log_Component_e a_component, string a_qualifier="", bool a_silent=false)
virtual ~log_EventLog ()
void ChangeQualifier (string a_newQual)

Private Attributes

 log_CLASSID_m
bool m_silent

Static Private Attributes

static bool m_created = false
 Flag to guarantee singleton.

Detailed Description

A class to initialize event logging in each of the processes.

Definition at line 93 of file eventlog.h.


Constructor & Destructor Documentation

log_EventLog::log_EventLog ( log_Component_e  a_component,
string  a_qualifier = "",
bool  a_silent = false 
)
Parameters:
a_component The ID of the component (executable ID).
a_qualifier [Optional] component's qualifier (partition name, library name, drive name...)
a_silent [Optional] Do not write start/stop messages

Definition at line 69 of file log_eventlogger.cpp.

References ChangeQualifier(), cmn_Global::evt, g_cmn, ivd_Versions::GetProductVersion(), ie_SINGLETON_EXISTS, IVD_COUT_LOG_m, ivd_Error, log_FUNC_m, log_WriteEvent(), m_created, m_silent, and log_EventLogger::SetComponent().

    :
    m_silent(a_silent) {

    IVD_COUT_LOG_m(" log_EventLog::log_EventLog " << " m_created = "  << boolalpha << m_created)

    log_FUNC_m(log_EventLog);

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

    g_cmn.evt.SetComponent(a_component);
    ChangeQualifier(a_qualifier);

    if (!m_silent) {
        ostringstream sstr;
        sstr << "Started (" << ivd_Versions::GetProductVersion() << ").";
        log_WriteEvent(sstr.str());
    }
}

Here is the call graph for this function:

log_EventLog::~log_EventLog (  )  [virtual]

Definition at line 99 of file log_eventlogger.cpp.

References ivd_Versions::GetProductVersion(), IVD_COUT_LOG_m, log_FUNC_m, log_WriteEvent(), and m_silent.

                            {
    IVD_COUT_LOG_m(" log_EventLog::~log_EventLog " )
    log_FUNC_m(log_EventLog);

    if (!m_silent) {
        ostringstream sstr;
        sstr << "Stopped (" << ivd_Versions::GetProductVersion() << ").";
        log_WriteEvent(sstr.str());
    }
}

Here is the call graph for this function:


Member Function Documentation

void log_EventLog::ChangeQualifier ( string  a_newQual  ) 

Definition at line 111 of file log_eventlogger.cpp.

References cmn_Global::evt, g_cmn, and log_EventLogger::SetQualifier().

Referenced by fs_api::EventMounted(), and log_EventLog().

                                                   {
    g_cmn.evt.SetQualifier(a_newQual);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 111 of file eventlog.h.

bool log_EventLog::m_created = false [static, private]

Flag to guarantee singleton.

Definition at line 114 of file eventlog.h.

Referenced by log_EventLog().

bool log_EventLog::m_silent [private]

Definition at line 115 of file eventlog.h.

Referenced by log_EventLog(), and ~log_EventLog().


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