Implements a platform-independent log...written to the console and, optionally, a file.
More...
#include <Log.h>
|
static Log * | Create (string const &_filename, bool const _bAppend, bool const _bConsoleOutput, LogLevel const _saveLevel, LogLevel const _queueLevel, LogLevel const _dumpTrigger) |
| Create a log. More...
|
|
static Log * | Create (i_LogImpl *LogClass) |
| Create a log. More...
|
|
static void | Destroy () |
| Destroys the log. More...
|
|
static bool | SetLoggingClass (i_LogImpl *LogClass, bool Append=false) |
| 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. 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. More...
|
|
static void | Write (LogLevel _level, char const *_format,...) |
| Write an entry to the log. More...
|
|
static void | Write (LogLevel _level, uint8 const _nodeId, char const *_format,...) |
| Write an entry to the log. More...
|
|
static void | QueueDump () |
| Send the queued log messages to the log output. More...
|
|
static void | QueueClear () |
|
Implements a platform-independent log...written to the console and, optionally, a file.
◆ Create() [1/2]
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
◆ Create() [2/2]
Create a log.
Creates the cross-platform logging singleton. Any previous log will be cleared.
- Parameters
-
LogClass | a Logging Class that inherits the i_LogImpl Class to use to Log |
- Returns
- a pointer to the logging object.
- See also
- Destroy, Write
◆ Destroy()
Destroys the log.
Destroys the logging singleton. The log can no longer be written to without another call to Create.
- See also
- Create, Write
◆ GetLoggingState() [1/2]
bool Log::GetLoggingState |
( |
| ) |
|
|
static |
Determine whether logging is enabled or not (retained for backward compatibility)
- Parameters
-
_dologging | If true, logging is enabled; if false, disabled |
◆ GetLoggingState() [2/2]
Obtain the various logging levels.
- Parameters
-
_saveLevel | LogLevel of messages to write in real-time |
_queueLevel | LogLevel of messages to queue to be dumped in case of an error |
_dumpTrigger | LogLevel of message that triggers a queue dump (probably LogLevel_Error or LogLevel_Warning) |
◆ QueueClear()
Clear the log message queue
◆ QueueDump()
Send the queued log messages to the log output.
◆ SetLogFileName()
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
-
_filename | Name of the new (or existing) file to use for log output. |
◆ SetLoggingClass()
bool Log::SetLoggingClass |
( |
i_LogImpl * |
LogClass, |
|
|
bool |
Append = false |
|
) |
| |
|
static |
Set the Logging Implementation Class to replace the standard File/Console logging.
- Parameters
-
LogClass | A Logging Class that inherits the i_LogImpl Class used to Log to |
Append | if this new Logging Class should be appended to the list of Logging Implementations, or replace the existing Logging Class |
- Returns
- Bool Value indicating success or failure
◆ SetLoggingState() [1/2]
void Log::SetLoggingState |
( |
bool |
_dologging | ) |
|
|
static |
Enable or disable library logging (retained for backward compatibility)
- Parameters
-
_dologging | If true, logging is enabled; if false, disabled |
◆ SetLoggingState() [2/2]
Enable or disable library logging.
To disable, set _saveLevel and _queueLevel to LogLevel_None.
- Parameters
-
_saveLevel | LogLevel of messages to write in real-time |
_queueLevel | LogLevel of messages to queue to be dumped in case of an error |
_dumpTrigger | LogLevel of message that triggers a queue dump (probably LogLevel_Error or LogLevel_Warning) |
◆ Write() [1/2]
void Log::Write |
( |
LogLevel |
_level, |
|
|
char const * |
_format, |
|
|
|
... |
|
) |
| |
|
static |
Write an entry to the log.
Writes a formatted string to the log.
- Parameters
-
_level | Specifies 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
◆ Write() [2/2]
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
-
_level | Specifies the type of log message (Error, Warning, Debug, etc.) |
_nodeId | Node 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: