Gateware Libraries  6.3.A
Beta Build
GW::SYSTEM::GLog Class Referenceabstract

Cross platform threadsafe logger. More...

#include <GLog.h>

Inheritance diagram for GW::SYSTEM::GLog:
GW::CORE::GMultiThreaded GW::CORE::GInterface

Public Member Functions

virtual GReturn Log (const char *const _log)=0
 Logs a null terminated string. More...
 
virtual GReturn LogCatergorized (const char *const _category, const char *const _log)=0
 Logs a null terminated string with a category. More...
 
virtual GReturn EnableVerboseLogging (bool _value)=0
 Turns verbose logging on or off. More...
 
virtual GReturn EnableConsoleLogging (bool _value)=0
 Turns console logging on or off. More...
 
virtual GReturn Flush ()=0
 Forces a log dump to file. More...
 
- Public Member Functions inherited from GW::CORE::GInterface
virtual GReturn GetCount (unsigned int &_outCount)=0
 Return the total number of active references to this object. More...
 
virtual GReturn IncrementCount ()=0
 Increase the total number of active references to this object. More...
 
virtual GReturn DecrementCount ()=0
 Decrease the total number of active references to this object. More...
 
virtual GReturn RequestInterface (const GUUIID &_interfaceID, void **_outputInterface)=0
 Requests an interface that may or may not be supported by this object. More...
 

Detailed Description

Cross platform threadsafe logger.

GLog inherits directly from GMultiThreaded, therefore its implementation must be thread safe.

Member Function Documentation

◆ EnableConsoleLogging()

virtual GReturn GW::SYSTEM::GLog::EnableConsoleLogging ( bool  _value)
pure virtual

Turns console logging on or off.

Use this function to ensure or prevent the additional console logging.

Parameters
[in]_valuetrue to turn on or false to turn off.

◆ EnableVerboseLogging()

virtual GReturn GW::SYSTEM::GLog::EnableVerboseLogging ( bool  _value)
pure virtual

Turns verbose logging on or off.

Use this function to ensure or prevent the addition of date, time, and threadID to your log messages.

Parameters
[in]_valuetrue to turn on or false to turn off.

◆ Flush()

virtual GReturn GW::SYSTEM::GLog::Flush ( )
pure virtual

Forces a log dump to file.

This will force a log dump to the file and clear the log queue.

Return values
SUCCESSSuccessfully dumped the logs.
FAILUREMost likely a file corruption or a file is not open.

◆ Log()

virtual GReturn GW::SYSTEM::GLog::Log ( const char *const  _log)
pure virtual

Logs a null terminated string.

Date, Time, and thread ID will be appended to the front of the message unless specified otherwise (See EnableVerboseLogging). A new line character will be appended to the end of the string so your log messages do not require a new line. The string is logged to the internal GFile object.

Parameters
[in]_logThe message to log out.
Return values
SUCCESSSuccessfully queued the message to the log.
FAILUREThe queue has reached maximum size (call flush).
INVALID_ARGUMENTA nullptr was passed in.

◆ LogCatergorized()

virtual GReturn GW::SYSTEM::GLog::LogCatergorized ( const char *const  _category,
const char *const  _log 
)
pure virtual

Logs a null terminated string with a category.

Date, Time, and thread ID will be appended to the front of the message unless specified otherwise (See EnableVerboseLogging). A new line character will be appended to the end of the string so your log messages do not require a new line. The string is logged to the internal GFile object.

Parameters
[in]_categoryThe category the log belongs in. ie. ERROR, WARNING, INFO, etc.
[in]_logThe message to log out.
Return values
SUCCESSSuccessfully queued the message to the log.
FAILUREThe queue has reached maximum size (call flush).
INVALID_ARGUMENTEither _category or _log are nullptr.

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