Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Util::Logger Class Reference

Defines a multi level static logger. More...

#include <logger.h>

Collaboration diagram for Brush::Util::Logger:

Public Member Functions

void set_log_level (int &verbosity)
 Sets the log level.
 
int get_log_level ()
 Gets the current log level.
 
string log (string m, int v, string sep="\n") const
 Prints a log message with verbosity control.
 

Static Public Member Functions

static LoggerinitLogger ()
 Initializes the logger instance.
 
static void destroy ()
 Destroys the logger instance.
 

Private Attributes

int verbosity
 The current log level.
 

Static Private Attributes

static Loggerinstance = NULL
 The singleton instance of the logger.
 

Detailed Description

Defines a multi level static logger.

Definition at line 19 of file logger.h.

Member Function Documentation

◆ destroy()

void Brush::Util::Logger::destroy ( )
static

Destroys the logger instance.

Definition at line 23 of file logger.cpp.

Here is the call graph for this function:

◆ get_log_level()

int Brush::Util::Logger::get_log_level ( )

Gets the current log level.

Returns
The current log level.

Definition at line 44 of file logger.cpp.

◆ initLogger()

Logger * Brush::Util::Logger::initLogger ( )
static

Initializes the logger instance.

Returns
A pointer to the logger instance.

Definition at line 13 of file logger.cpp.

◆ log()

string Brush::Util::Logger::log ( string m,
int v,
string sep = "\n" ) const

Prints a log message with verbosity control.

print message with verbosity control.

Parameters
mThe log message to be printed.
vThe verbosity level of the log message.
sepThe separator to be used between log messages.
Returns
The formatted log message.

Definition at line 50 of file logger.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_log_level()

void Brush::Util::Logger::set_log_level ( int & verbosity)

Sets the log level.

Parameters
verbosityThe log level to be set.

Definition at line 31 of file logger.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ instance

Logger * Brush::Util::Logger::instance = NULL
staticprivate

The singleton instance of the logger.

Definition at line 57 of file logger.h.

◆ verbosity

int Brush::Util::Logger::verbosity
private

The current log level.

Definition at line 56 of file logger.h.


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