ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Static Fields | Public Static Methods | List of all members
Log Class Reference
Collaboration diagram for Log:
[legend]

Class Description


Holds static objects used for standard debug logging and provides an interface to create such objects. If compiler symbol ALOX_DBG_LOG is set to 0, this class will be empty.

Note
: In C# and Java, this class is the interface class for debug logging which gets pruned, and mimics the functionality of class Lox. In C++, there is no need to double functionality of Lox here.

Definition at line 48 of file log.inl.

Public Static Fields

static ALIB_API detail::textlogger::TextLoggerDebugLogger = nullptr
 
static ALoxReportWriterDebugReportWriter = nullptr
 
static ALIB_API detail::textlogger::TextLoggerIDELogger = nullptr
 

Public Static Methods

static ALIB_API void AddALibReportWriter (Lox *lox)
 
static ALIB_API void AddDebugLogger (Lox *lox)
 
static ALIB_FORCE_INLINE LoxGet ()
 
static ALIB_API void RemoveALibReportWriter ()
 
static ALIB_API void RemoveDebugLogger (Lox *lox)
 

Member Function Documentation

◆ AddALibReportWriter()

void AddALibReportWriter ( Lox lox)
static

In the case that the original ALib ReportWriterStdIO is still in place, Report::PushWriter is invoked to provide a ReportWriter of type ALoxReportWriter.

Note
This method is effective only with debug builds. Usually it is invoked indirectly by using method AddDebugLogger. Applications that do not use that method (e.g. because they are using release logging exclusively), should invoke this method on bootstrap providing their (release) lox. In this case, the Verbosity of the internal domain used by class ALoxReportWriter has to be set for the the logger(s) in given lox in question.
Parameters
loxThe lox that the ALoxReportWriter created will be using.

Definition at line 128 of file log.cpp.

Here is the call graph for this function:

◆ AddDebugLogger()

void AddDebugLogger ( Lox lox)
static

This method creates an adequate/default debug logger. It is used by macro Log_AddDebugLogger also automatically invoked when debug logging is used without the explicit creation and registration of any other logger.

Of-course, alternatively to using this method (resp. the macro), a suitable (set of) debug logger(s) can be created manually. Also, before or after using this method additional debug loggers may be created.

In the current version of ALox (future changes are likely), this method does:

  • use Lox::CreateConsoleLogger to create the best compatible console logger for the running platform
  • this logger will be added to the debug Lox object with specifying Verbosity::Error for internal domains.
  • If under windows, a Visual Studio debug session is running, adds a VStudioLogger in addition to the standard console logger. This can be suppressed using configuration variable ALOX_NO_IDE_LOGGER .

The name of the Logger created is "DEBUG_LOGGER". It will be registered with the standard Lox used for debug-logging, by setting Verbosities

An optionally created second, IDE-specific Logger will be named "IDE_LOGGER" and will be registered with the standard Lox used for debug-logging with the same Verbosities as "DEBUG_LOGGER" is.

Finally, this method also invokes AddALibReportWriter.

Parameters
loxThe lox to add the debug logger(s) to.

Definition at line 50 of file log.cpp.

Here is the call graph for this function:

◆ Get()

static ALIB_FORCE_INLINE Lox* Get ( )
inlinestatic

Returns the default singleton of class Lox used for debug logging.

Returns
The debug-logging Lox of ALox

Definition at line 79 of file log.inl.

◆ RemoveALibReportWriter()

void RemoveALibReportWriter ( )
static

Removes the report writer created with AddALibReportWriter.

Definition at line 138 of file log.cpp.

Here is the call graph for this function:

◆ RemoveDebugLogger()

void RemoveDebugLogger ( Lox lox)
static

Removes the Logger(s) and which was (were) created by AddDebugLogger. This method also invokes RemoveALibReportWriter.

Parameters
loxThe lox to remove the debug logger(s) from.

Definition at line 95 of file log.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ DebugLogger

TextLogger * DebugLogger = nullptr
static

The debug logger created by AddDebugLogger.

Definition at line 58 of file log.inl.

◆ DebugReportWriter

ALoxReportWriter * DebugReportWriter = nullptr
static

The ALib ReportWriter. This will be created and registered in method Log::AddDebugLogger and removed and deleted in Log::RemoveDebugLogger in the case that the original ALib ReportWriterStdIO is in place.

Definition at line 68 of file log.inl.

◆ IDELogger

TextLogger * IDELogger = nullptr
static

An (additional) IDE specific logger, that might be created by AddDebugLogger.

Definition at line 61 of file log.inl.


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