Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

log_Debugger Class Reference

Class to control debugging execution. More...

#include <debug.h>

Inheritance diagram for log_Debugger:
Inheritance graph
Collaboration diagram for log_Debugger:
Collaboration graph

List of all members.

Public Member Functions

 log_Debugger (bool &m_active)
virtual ~log_Debugger ()
 Destructor automatically closes debugging file if debugging is still active at the end of the program execution.
void CloseF ()
void SetFileName (const cmn_Path &a_path)
void On ()
 Turns on debugging and writes a file header.
void On (log_DbgLevel_t a_level, UInt32_t a_flags, const string &a_filename="")
void SetArgs (char a_argLevel, const string &a_argFile, const string &a_argFlags)
void Off ()
void SetLevel (log_DbgLevel_t a_level)
void SetFlags (UInt32_t a_flags)
void SetProcName (const char *a_procName)
log_DbgLevel_t GetLevel () const
UInt32_t GetFlags () const
string GetArgLevel () const
string GetArgFile () const
string GetArgFlags () const
void WriteHeader (ostringstream &a_dbgFormatted, log_DbgLevel_t a_level, const log_FunctionID &a_fcnID, long a_line)
 Write header of the message based on previously set parameters.
void Write (log_DbgLevel_t a_level, ostringstream &a_dbgFormatted)
 Writes the formatted debug text to output stream.
void SetExternalDebugger (void(*a_extDbgOn)(log_DbgLevel_t, bool a_verbose), void(*a_extDbgOff)())

Private Member Functions

void ChangeParams (log_DbgLevel_t a_level, UInt32_t a_flags, const string &a_filename)

Private Attributes

cmn_Mutex m_debugOut_x
cmn_Mutex m_onOff_x
log_DbgLevel_t m_level
UInt32_t m_flags
bool & m_active
string m_procName
string m_argLevel
string m_argFile
string m_argFlags
void(* m_extDbgOn )(log_DbgLevel_t a_level, bool a_verbose)
 Pointer to exteral function to turn on debugging (CORBA).
void(* m_extDbgOff )()
 Pointer to exteral function to turn off debugging (CORBA).

Static Private Attributes

static bool m_created = false
 Flag to guarantee singleton.

Detailed Description

Class to control debugging execution.

It is an internal singleton, used by log_DBG_m and functions that control debugging process.

See also:

Definition at line 186 of file debug.h.

Constructor & Destructor Documentation

log_Debugger::log_Debugger ( bool &  a_active  ) 

Definition at line 123 of file log_debugger.cpp.

References ie_SINGLETON_EXISTS, IVD_COUT_LOG_m, ivd_Error, m_active, m_created, and s_levels.

    : log_File(false),
      m_extDbgOff(NULL) {

    IVD_COUT_LOG_m(" log_Debugger::log_Debugger() " << boolalpha << m_active)
    //cout << " log_Debugger::log_Debugger() " << boolalpha << m_active;

    // Singleton check.
    if (m_created) {
        throw ivd_Error(ie_SINGLETON_EXISTS, "", true);
    else {
        m_created = true;
    s_levels[dbg_LOW]    = 'L';
    s_levels[dbg_NORM]   = 'N';
    s_levels[dbg_EXTAPI] = 'A';
    s_levels[dbg_DETAIL] = 'D';

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