ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
Log Class Reference


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.

Definition at line 43 of file log.inl.

Collaboration diagram for Log:

Public Static Field Index:

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

Public Static Method Index:

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)

Field Details:

◆ DebugLogger

TextLogger * DebugLogger = nullptr

The debug logger created by AddDebugLogger.

Definition at line 53 of file log.inl.

◆ DebugReportWriter

ALoxReportWriter * DebugReportWriter = nullptr

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 63 of file log.inl.

◆ IDELogger

TextLogger * IDELogger = nullptr

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

Definition at line 56 of file log.inl.

Method Details:

◆ AddALibReportWriter()

void AddALibReportWriter ( Lox * lox)

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

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.
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)

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

  • Verbosity::Verbose for the root domain '/' and
  • Verbosity::Warning for internal domains.

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.

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 ( )

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

The debug-logging Lox of ALox

Definition at line 74 of file log.inl.

◆ RemoveALibReportWriter()

void RemoveALibReportWriter ( )

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)

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

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:

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