ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
FormatMetaInfo Struct Reference

Description:

Definition of the main log-line format string for class textlogger::TextLogger and its derivates. This struct is used to define an external configuration variable named ALOX/LOGGERNAME/FORMAT. This variable can be accessed programatically with TextLogger::GetFormatMetaInfo or by accessing the variable's value through the configuration object found in camp singleton alib::ALOX.

Definition at line 29 of file variables.hpp.

#include <variables.hpp>

Collaboration diagram for FormatMetaInfo:
[legend]

Public Field Index:

AStringPA Format
 
AStringPA MsgSuffix
 
AStringPA VerbosityError
 
AStringPA VerbosityInfo
 
AStringPA VerbosityVerbose
 
AStringPA VerbosityWarning
 

Public Method Index:

 FormatMetaInfo (PoolAllocator &pool)
 

Field Details:

◆ Format

The line format specifies the (automated) log output that is prepended to each log line before the log message itself. This format string can be changed after the creation of a TextLogger.

The string supports replacement variables that begin with a % character:

  • %SP: The full path of the source file
  • %Sp: The trimmed path of the source file
  • %SF: The caller's source file name
  • %Sf: The caller's source file name without extension
  • %SL: The line number in the source file
  • %SM: The method name
  • %TD: The date the log call was invoked
  • %TT: Time of day the log call was invoked
  • %TC: Time elapsed since the Logger was created or its timer was reset
  • %TL: Time elapsed since the last log call
  • %tN: Thread name
  • %tI: Thread ID
  • %V: The verbosity. This is replaced by the corresponding strings found in fields VerbosityError, VerbosityWarning, VerbosityInfo and VerbosityVerbose.
  • %D: Log domain
  • %#: The log call counter (like a line counter, but counting multi lines as one)
  • %An: An auto-adjusted tabulator. This grows whenever it needs, but never shrinks. The optional integer number n specifies how much extra space is added when tab is adjusted. Setting this to a higher value avoids too many adjustments at the beginning of a log session.
  • %LG: The name of the Logger. This might be useful if multiple loggers write to the same output stream (e.g., Console).
  • %LX: The name of the Lox.
  • %P: The name of the process / application.

Resourced default is

"%Sp/%SF(%SL):%A5%SM() %A5[%TC +%TL][%tN]%V[%D]%A1(%#): "

If debug logging as well as release logging has scope information disabled (see ALOX_DBG_LOG_CI and ALOX_REL_LOG_CI), then it defaults to: "[%TC +%TL][%tN]%V[%D]%A1(%#): "

Note
The use of %TD and %TT may become problematic and ambiguous if the system clock is changed during a software run. Especially for long-running background software (daemons, servers, etc.), the software that uses ALox needs to provide a strategy of synchronizing the clock with field TextLogger::DateConverter.
For some explanation of the problem see details of namespace alib::time.

Definition at line 76 of file variables.hpp.

◆ MsgSuffix

AStringPA MsgSuffix

Characters written after each Log Statement. This may be used for example to reset colors and styles. Note, that with multi-line Log Statements, the contents of this field is not written at the end of each line, but only at the end of the last line. To define characters that are written after each line of a multi-line Log Statement, set field MsgSuffix.

Defaults to empty string.

Definition at line 102 of file variables.hpp.

◆ VerbosityError

AStringPA VerbosityError

The replacement for variable %V in field Format if Verbosity is Error. Resourced as '[ERR]'.

Definition at line 80 of file variables.hpp.

◆ VerbosityInfo

AStringPA VerbosityInfo

The replacement for variable %V in field Format if Verbosity is Info. Resourced as ' '.

Definition at line 88 of file variables.hpp.

◆ VerbosityVerbose

AStringPA VerbosityVerbose

The replacement for variable %V in field Format if Verbosity is Verbose. Resourced as to '[***]'.

Definition at line 92 of file variables.hpp.

◆ VerbosityWarning

AStringPA VerbosityWarning

The replacement for variable %V in field Format if Verbosity is Warning. Resourced as '[WRN]'.

Definition at line 84 of file variables.hpp.

Constructor(s) / Destructor Details:

◆ FormatMetaInfo()

FormatMetaInfo ( PoolAllocator & pool)
inline

Constructor taking an object pool which is passed to each string member.

Parameters
poolThe pool object of the Configuration.

Definition at line 107 of file variables.hpp.


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