GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Static Private Attributes | List of all members
GLC_TraceLog Class Reference

GLC_TraceLog : handle GLC_lib trace log. More...

#include <glc_tracelog.h>

+ Inheritance diagram for GLC_TraceLog:

Public Member Functions

Private services Functions
void writeHeader ()
 Write trace Log header.
 
- Public Member Functions inherited from GLC_Log
QString fullFileName () const
 Return this log full file name.
 
virtual ~GLC_Log ()
 Destructor.
 

Static Public Member Functions

Get Functions
static GLC_TraceLoginstance (QString baseName=QString())
 Return the unique instance of trace log file.
 
static bool isEmpty ()
 Return true if the log is empty.
 
static bool isEnable ()
 Return true if the trace log is enable.
 
Set Functions
static void addTrace (const QStringList &traceDescription)
 Add error into the log.
 
static void close ()
 Close the log file.
 
static void setEnabled (bool enable)
 Set enable.
 

Static Private Attributes

static GLC_TraceLogm_pTraceLog = NULL
 The unique trace log instance.
 
static QMutex m_Mutex
 The mutex of this unique log.
 
static bool m_IsEnable = false
 the trace log enable status
 

Constructor

 GLC_TraceLog (const QString &fullLogFileName)
 Private constructor.
 
virtual ~GLC_TraceLog ()
 Destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from GLC_Log
void add (const QString &line)
 Add the given string to this log.
 
void addBlankLine ()
 Add blank line to this log.
 
void addSeparator ()
 Add a separator in the log.
 
void addCurrentTime ()
 Add current time in log.
 
 GLC_Log (const QString &baseLogFileName)
 Construct a log of the given base fileName.
 
- Protected Attributes inherited from GLC_Log
QTemporaryFile * m_pFile
 This log file.
 
QTextStream m_TextStream
 This log textStream.
 

Detailed Description

GLC_TraceLog : handle GLC_lib trace log.

Definition at line 35 of file glc_tracelog.h.

Constructor & Destructor Documentation

GLC_TraceLog::GLC_TraceLog ( const QString &  fullLogFileName)
private

Private constructor.

Definition at line 33 of file glc_tracelog.cpp.

Referenced by instance().

GLC_TraceLog::~GLC_TraceLog ( )
virtual

Destructor.

Definition at line 39 of file glc_tracelog.cpp.

Member Function Documentation

void GLC_TraceLog::addTrace ( const QStringList &  traceDescription)
static

Add error into the log.

Definition at line 77 of file glc_tracelog.cpp.

References GLC_Log::add(), GLC_Log::addCurrentTime(), GLC_Log::addSeparator(), instance(), m_IsEnable, and m_Mutex.

Referenced by GLC_BSRep::isUsable(), and GLC_BSRep::open().

void GLC_TraceLog::close ( )
static

Close the log file.

Definition at line 91 of file glc_tracelog.cpp.

References m_Mutex, and m_pTraceLog.

GLC_TraceLog * GLC_TraceLog::instance ( QString  baseName = QString())
static

Return the unique instance of trace log file.

Definition at line 44 of file glc_tracelog.cpp.

References GLC_TraceLog(), m_pTraceLog, and writeHeader().

Referenced by addTrace().

bool GLC_TraceLog::isEmpty ( void  )
static

Return true if the log is empty.

Definition at line 67 of file glc_tracelog.cpp.

References m_pTraceLog.

bool GLC_TraceLog::isEnable ( )
static

Return true if the trace log is enable.

Definition at line 72 of file glc_tracelog.cpp.

References m_IsEnable.

Referenced by GLC_BSRep::isUsable(), and GLC_BSRep::open().

void GLC_TraceLog::setEnabled ( bool  enable)
static

Set enable.

Definition at line 98 of file glc_tracelog.cpp.

References m_IsEnable.

void GLC_TraceLog::writeHeader ( )

Write trace Log header.

Definition at line 103 of file glc_tracelog.cpp.

References GLC_Log::m_TextStream.

Referenced by instance().

Member Data Documentation

bool GLC_TraceLog::m_IsEnable = false
staticprivate

the trace log enable status

Definition at line 101 of file glc_tracelog.h.

Referenced by addTrace(), isEnable(), and setEnabled().

QMutex GLC_TraceLog::m_Mutex
staticprivate

The mutex of this unique log.

Definition at line 98 of file glc_tracelog.h.

Referenced by addTrace(), and close().

GLC_TraceLog * GLC_TraceLog::m_pTraceLog = NULL
staticprivate

The unique trace log instance.

Definition at line 95 of file glc_tracelog.h.

Referenced by close(), instance(), and isEmpty().


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

©2005-2013 Laurent Ribon