OpenZWave Library  1.4.2944
Static Public Member Functions | List of all members
OpenZWave::Log Class Reference

Implements a platform-independent log...written to the console and, optionally, a file. More...

#include <Log.h>

Static Public Member Functions

static LogCreate (string const &_filename, bool const _bAppend, bool const _bConsoleOutput, LogLevel const _saveLevel, LogLevel const _queueLevel, LogLevel const _dumpTrigger)
 
static LogCreate (i_LogImpl *LogClass)
 
static void Destroy ()
 
static bool SetLoggingClass (i_LogImpl *LogClass)
 Set the Logging Implementation Class to replace the standard File/Console logging. More...
 
static void SetLoggingState (bool _dologging)
 Enable or disable library logging (retained for backward compatibility) More...
 
static void SetLoggingState (LogLevel _saveLevel, LogLevel _queueLevel, LogLevel _dumpTrigger)
 Enable or disable library logging. To disable, set _saveLevel and _queueLevel to LogLevel_None. More...
 
static bool GetLoggingState ()
 Determine whether logging is enabled or not (retained for backward compatibility) More...
 
static void GetLoggingState (LogLevel *_saveLevel, LogLevel *_queueLevel, LogLevel *_dumpTrigger)
 Obtain the various logging levels. More...
 
static void SetLogFileName (const string &_filename)
 Change the log file name. This will start a new log file (or potentially start appending information to an existing one. Developers might want to use this function, together with a timer in the controlling application, to create timestamped log file names. More...
 
static void Write (LogLevel _level, char const *_format,...)
 
static void Write (LogLevel _level, uint8 const _nodeId, char const *_format,...)
 
static void QueueDump ()
 
static void QueueClear ()
 

Detailed Description

Implements a platform-independent log...written to the console and, optionally, a file.

Member Function Documentation

Log * Log::Create ( string const &  _filename,
bool const  _bAppend,
bool const  _bConsoleOutput,
LogLevel const  _saveLevel,
LogLevel const  _queueLevel,
LogLevel const  _dumpTrigger 
)
static

Create a log. Creates the cross-platform logging singleton. Any previous log will be cleared.

Returns
a pointer to the logging object.
See also
Destroy, Write
static Log* OpenZWave::Log::Create ( i_LogImpl LogClass)
static

Create a log. Creates the cross-platform logging singleton. Any previous log will be cleared.

Parameters
LogClassa Logging Class that inherits the i_LogImpl Class to use to Log
Returns
a pointer to the logging object.
See also
Destroy, Write
void Log::Destroy ( )
static

Destroys the log. Destroys the logging singleton. The log can no longer be written to without another call to Create.

See also
Create, Write
bool Log::GetLoggingState ( )
static

Determine whether logging is enabled or not (retained for backward compatibility)

Parameters
_dologgingIf true, logging is enabled; if false, disabled
static void OpenZWave::Log::GetLoggingState ( LogLevel _saveLevel,
LogLevel _queueLevel,
LogLevel _dumpTrigger 
)
static

Obtain the various logging levels.

Parameters
_saveLevelLogLevel of messages to write in real-time
_queueLevelLogLevel of messages to queue to be dumped in case of an error
_dumpTriggerLogLevel of message that triggers a queue dump (probably LogLevel_Error or LogLevel_Warning)
void Log::QueueClear ( )
static

Clear the log message queue

void Log::QueueDump ( )
static

Send the queued log messages to the log output.

void Log::SetLogFileName ( const string &  _filename)
static

Change the log file name. This will start a new log file (or potentially start appending information to an existing one. Developers might want to use this function, together with a timer in the controlling application, to create timestamped log file names.

Parameters
_filenameName of the new (or existing) file to use for log output.
bool Log::SetLoggingClass ( i_LogImpl LogClass)
static

Set the Logging Implementation Class to replace the standard File/Console logging.

Parameters
LogClassA Logging Class that inherits the i_LogImpl Class used to Log to
Returns
Bool Value indicating success or failure
void Log::SetLoggingState ( bool  _dologging)
static

Enable or disable library logging (retained for backward compatibility)

Parameters
_dologgingIf true, logging is enabled; if false, disabled
void Log::SetLoggingState ( LogLevel  _saveLevel,
LogLevel  _queueLevel,
LogLevel  _dumpTrigger 
)
static

Enable or disable library logging. To disable, set _saveLevel and _queueLevel to LogLevel_None.

Parameters
_saveLevelLogLevel of messages to write in real-time
_queueLevelLogLevel of messages to queue to be dumped in case of an error
_dumpTriggerLogLevel of message that triggers a queue dump (probably LogLevel_Error or LogLevel_Warning)
void Log::Write ( LogLevel  _level,
char const *  _format,
  ... 
)
static

Write an entry to the log. Writes a formatted string to the log.

Parameters
_levelSpecifies the type of log message (Error, Warning, Debug, etc.)
_format.A string formatted in the same manner as used with printf etc.
...a variable number of arguments, to be included in the formatted string.
See also
Create, Destroy
void Log::Write ( LogLevel  _level,
uint8 const  _nodeId,
char const *  _format,
  ... 
)
static

Write an entry to the log. Writes a formatted string to the log.

Parameters
_levelSpecifies the type of log message (Error, Warning, Debug, etc.)
_nodeIdNode Id this entry is about.
_format.A string formatted in the same manner as used with printf etc.
...a variable number of arguments, to be included in the formatted string.
See also
Create, Destroy

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