ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lox::Log Class Reference

Description:

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

Definition at line 35 of file log.inl.

Collaboration diagram for alib::lox::Log:
[legend]

Public Static Field Index:

static ALIB_DLL textlogger::TextLoggerDebugLogger = nullptr
 The debug logger created by AddDebugLogger.
 
static ALIB_DLL textlogger::TextLoggerIDELogger = nullptr
 An (additional) IDE specific logger, that might be created by AddDebugLogger.
 

Public Static Method Index:

static ALIB_DLL void AddDebugLogger (Lox *lox)
 
static LoxGet ()
 
static ALIB_DLL void RemoveDebugLogger (Lox *lox)
 
static ALIB_DLL void SetALibAssertionPlugin (Lox *lox)
 

Field Details:

◆ DebugLogger

TextLogger * alib::lox::Log::DebugLogger = nullptr
static

The debug logger created by AddDebugLogger.

Definition at line 40 of file log.inl.

◆ IDELogger

TextLogger * alib::lox::Log::IDELogger = nullptr
static

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

Definition at line 43 of file log.inl.

Method Details:

◆ AddDebugLogger()

void alib::lox::Log::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

  • 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 SetALibAssertionPlugin.

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

Definition at line 207 of file alox.cpp.

◆ Get()

Lox * alib::lox::Log::Get ( )
inlinestatic

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

Returns
The debug-logging Lox of ALox

Definition at line 47 of file log.inl.

◆ RemoveDebugLogger()

void alib::lox::Log::RemoveDebugLogger ( Lox * lox)
static

Removes the Logger(s) and which was (were) created by AddDebugLogger. This method also invokes SetALibAssertionPlugin, passing nullptr to unregister the plug-in.

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

Definition at line 275 of file alox.cpp.

Here is the call graph for this function:

◆ SetALibAssertionPlugin()

void alib::lox::Log::SetALibAssertionPlugin ( Lox * lox)
static

Sets the global pointer assert::PLUGIN to function ALoxAssertionPlugin which then redirects the output of ALib assertions to the given Lox.

Note
This method is effective only with debug-builds. Usually it is invoked indirectly by using the 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 function ALoxAssertionPlugin has to be set for the logger(s) in the given lox in question.
Parameters
loxThe lox that the ALoxAssertionPlugin will be using. If nullptr is given, the plug-in will be removed.

Definition at line 336 of file alox.cpp.

Here is the call graph for this function:

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