Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
log.h File Reference

Logging. More...

#include "roc_core/atomic_ops.h"
#include "roc_core/attributes.h"
#include "roc_core/log_backend.h"
#include "roc_core/mutex.h"
#include "roc_core/noncopyable.h"
#include "roc_core/singleton.h"
#include "roc_core/time.h"
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  roc::core::LogMessage
 Log message. More...
 
class  roc::core::Logger
 Logger. More...
 

Namespaces

 roc
 Root namespace.
 
 roc::core
 General-purpose building blocks and platform abstraction layer.
 

Macros

#define roc_log(level, ...)
 Print message to log. More...
 

Typedefs

typedef void(* roc::core::LogHandler) (const LogMessage &message, void **args)
 Log handler. More...
 

Enumerations

enum  roc::LogLevel {
  roc::LogNone , roc::LogError , roc::LogInfo , roc::LogNote ,
  roc::LogDebug , roc::LogTrace
}
 Log level. More...
 
enum  roc::core::ColorsMode { roc::core::ColorsAuto , roc::core::ColorsEnabled , roc::core::ColorsDisabled }
 Colors mode. More...
 
enum  roc::core::LocationMode { roc::core::LocationEnabled , roc::core::LocationDisabled }
 Location mode. More...
 

Detailed Description

Logging.

Definition in file log.h.

Macro Definition Documentation

◆ roc_log

#define roc_log (   level,
  ... 
)
Value:
do { \
if ((level) <= logger.get_level()) { \
logger.writef((level), ROC_STRINGIZE(ROC_MODULE), __FILE__, __LINE__, \
__VA_ARGS__); \
} \
} while (0)
Logger.
Definition: log.h:102
LogLevel get_level() const
Get current maximum log level.
Definition: log.h:119
static Logger & instance()
Get logger instance.
Definition: log.h:105
#define ROC_STRINGIZE(s)
Stringize macro.
Definition: macro_helpers.h:44

Print message to log.

Remarks
If the given log level is disabled, this call does not insert memory barriers and does not evaluate arguments except level.

Definition at line 31 of file log.h.