Immersitech Logo Developer Resources
imm_logger Class Reference

Logger class. More...

#include <immersitech_general.h>

Public Member Functions

virtual ~imm_logger ()
 Destroy the logger object. More...
 
void initialize (imm_logger_handler *handler)
 Initialize logger with speficied handler. More...
 
virtual void log (imm_log_level level, const char *format,...)
 write a message to a log More...
 
void set_enabled (bool enable)
 Turn the logger on or off. More...
 
void set_log_level (imm_log_level level)
 Set the log level. More...
 

Static Public Member Functions

static imm_loggerget_logger ()
 Get the logger object. More...
 
static std::string to_string (imm_log_level level)
 Convert log level to string. More...
 

Detailed Description

Logger class.

Constructor & Destructor Documentation

◆ ~imm_logger()

virtual imm_logger::~imm_logger ( )
virtual

Destroy the logger object.

Member Function Documentation

◆ get_logger()

static imm_logger * imm_logger::get_logger ( )
static

Get the logger object.

Returns
A pointer to the logger

◆ initialize()

void imm_logger::initialize ( imm_logger_handler handler)

Initialize logger with speficied handler.

◆ log()

virtual void imm_logger::log ( imm_log_level  level,
const char *  format,
  ... 
)
virtual

write a message to a log

Parameters
[in]levelThe log level which this message should be printed with
[in]formatA character array that can be overload just like the printf() function. For example: log(IMM_LOG_DEBUG, "The number is %i for participant %s", number, name);

◆ set_enabled()

void imm_logger::set_enabled ( bool  enable)

Turn the logger on or off.

Parameters
[in]enableA boolean describing if you'd like the logger to be active

◆ set_log_level()

void imm_logger::set_log_level ( imm_log_level  level)

Set the log level.

Parameters
[in]levelCurrent log level the logger passes to the log

◆ to_string()

static std::string imm_logger::to_string ( imm_log_level  level)
static

Convert log level to string.

Parameters
[in]levellog level as an enum value
Returns
log leve as a string

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