OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::logger Class Referencefinal

The global class to output logging streams. Its usage requires the static method: logger::out() More...

#include <logger.hpp>

Public Types

enum  logSeverity {
  none , fatal , error , warning ,
  info , debug , verbose
}
 

Static Public Member Functions

static loggerout (const logSeverity s)
 Specify a new logger output with severity level of information (if defined).
 
static loggervar (const void &v)
 Specify that the variable given by v should be printed with its own name : <var::name> = <var::value>
 

Public Attributes

const lout_base dec
 Modifies the default numeric base to decimal for integer logger output Example:
 
const lout_base hex
 Modifies the default numeric base to hexadecimal for integer logger output Example:
 
const lout_base oct
 Modifies the default numeric base to octal for integer logger output Example:
 
const lout_base bin
 Modifies the default numeric base to binary for integer logger output Example:
 
const char *const endl
 Inserts a new-line character to the logger output. Example:
 
const char *const end
 Inserts a new-line character to the logger output and restore the default color Example:
 
const char *const nrm
 Set colored output to "normal" after the usage of this statement Example:
 
const char *const red
 Set colored output to "red" after the usage of this statement Example:
 
const char *const grn
 Set colored output to "green" after the usage of this statement Example:
 
const char *const yel
 Set colored output to "yellow" after the usage of this statement Example:
 
const char *const blu
 Set colored output to "blue" after the usage of this statement Example:
 
const char *const mag
 Set colored output to "magenta" after the usage of this statement Example:
 
const char *const cyn
 Set colored output to "cyan" after the usage of this statement Example:
 
const char *const wht
 Set colored output to "white" after the usage of this statement Example:
 

Detailed Description

The global class to output logging streams. Its usage requires the static method: logger::out()

Member Function Documentation

◆ out()

static logger & qOS::logger::out ( const logSeverity s)
static

Specify a new logger output with severity level of information (if defined).

Note
Should be used only at the beginning of logger stream
Parameters
[in]sSeverity of the message

Example 1:

logger::out() << "some message" << logger::endl;

Example 2:

logger::out(logger::info) << "some information message" << logger::endl;

Example 3:

logger::out(logger::debug) << "some debug message" << logger::endl;

◆ var()

static logger & qOS::logger::var ( const void & v)
static

Specify that the variable given by v should be printed with its own name : <var::name> = <var::value>

Parameters
[in]vvariable to be logged
int myVariable;
logger::out() << logger::var( myVariable ) << logger::endl;