Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::Logger Class Reference

Logger. More...

#include <log.h>

Inheritance diagram for roc::core::Logger:
Collaboration diagram for roc::core::Logger:

Public Member Functions

void writef (LogLevel level, const char *module, const char *file, int line, const char *format,...)
 Print message to log. More...
 
LogLevel get_level () const
 Get current maximum log level. More...
 
void set_verbosity (unsigned)
 Set verbosity level. More...
 
void set_level (LogLevel)
 Set maximum log level. More...
 
void set_colors (ColorsMode)
 Set colors mode. More...
 
void set_handler (LogHandler handler, void **args, size_t n_args)
 Set log handler. More...
 

Static Public Member Functions

static Loggerinstance ()
 Get logger instance. More...
 

Friends

class Singleton< Logger >
 

Detailed Description

Logger.

Definition at line 102 of file log.h.

Member Function Documentation

◆ get_level()

LogLevel roc::core::Logger::get_level ( ) const
inline

Get current maximum log level.

Definition at line 119 of file log.h.

◆ instance()

static Logger& roc::core::Logger::instance ( )
inlinestatic

Get logger instance.

Definition at line 105 of file log.h.

◆ set_colors()

void roc::core::Logger::set_colors ( ColorsMode  )

Set colors mode.

Note
Other threads will see the change immediately.

◆ set_handler()

void roc::core::Logger::set_handler ( LogHandler  handler,
void **  args,
size_t  n_args 
)

Set log handler.

Remarks
If handler is not NULL, log messages and arg will be passed to handler. Otherwise, they're printed to stderr.
Note
Other threads will see the change immediately.

◆ set_level()

void roc::core::Logger::set_level ( LogLevel  )

Set maximum log level.

Remarks
Messages with higher log level will be dropped.
Note
Other threads are not guaranteed to see the change immediately.

◆ set_verbosity()

void roc::core::Logger::set_verbosity ( unsigned  )

Set verbosity level.

Remarks
Sets logging level according to requested verbosity level.

◆ writef()

void roc::core::Logger::writef ( LogLevel  level,
const char *  module,
const char *  file,
int  line,
const char *  format,
  ... 
)

Print message to log.


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