pianod2
multisource multiuser scriptable networked music player
Macros | Typedefs | Enumerations | Functions | Variables
logging.h File Reference

Debug/event logging interface. More...

#include <config.h>
#include <cstring>
#include <cstdarg>
#include <iostream>
#include <utility>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOG_WHERE(level)   (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "
 
#define LOG_FUNCTION(level)   (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "
 

Typedefs

typedef enum log_types_t LOG_TYPE
 

Enumerations

enum  log_types_t {
  LOG_ERROR = 0, LOG_000 = 0x01, LOG_100 = 0x02, LOG_200 = 0x04,
  LOG_300 = 0x08, LOG_400 = 0x10, LOG_500 = 0x20, LOG_GENERAL = 0x80,
  LOG_EVENT = 0x100, LOG_WARNING = 0x200, LOG_USERACTION = 0x1000, LOG_PROTOCOL = 0x2000,
  LOG_ALLOCS = 0x4000, LOG_CACHES = 0x8000, LOG_TUNING = 0x10000, LOG_BIASING = 0x20000,
  LOG_PANDORA = 0x100000
}
 

Functions

void set_logging (unsigned logtype)
 
static const char * trim_filename (const char *path)
 
void flog_details (void)
 Implement empty argument list for flogging. More...
 
bool logging_enabled (LOG_TYPE level)
 
template<typename OutputItem , typename... MoreItems>
void flog_details (OutputItem message, MoreItems &&... more)
 Recurse while there are arguments for flogging. More...
 
template<typename... MoreItems>
void flog (LOG_TYPE level, MoreItems &&... more)
 Log messages when their logging category is enabled. More...
 

Variables

LOG_TYPE flogging_level
 

Detailed Description

Debug/event logging interface.

Macro Definition Documentation

◆ LOG_FUNCTION

#define LOG_FUNCTION (   level)    (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "

◆ LOG_WHERE

#define LOG_WHERE (   level)    (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "

Typedef Documentation

◆ LOG_TYPE

typedef enum log_types_t LOG_TYPE

Enumeration Type Documentation

◆ log_types_t

Enumerator
LOG_ERROR 
LOG_000 
LOG_100 
LOG_200 
LOG_300 
LOG_400 
LOG_500 
LOG_GENERAL 
LOG_EVENT 
LOG_WARNING 
LOG_USERACTION 
LOG_PROTOCOL 
LOG_ALLOCS 
LOG_CACHES 
LOG_TUNING 
LOG_BIASING 
LOG_PANDORA 

Function Documentation

◆ flog()

template<typename... MoreItems>
void flog ( LOG_TYPE  level,
MoreItems &&...  more 
)

Log messages when their logging category is enabled.

Errors are always logged. Message to to standard out.

Here is the call graph for this function:

◆ flog_details() [1/2]

template<typename OutputItem , typename... MoreItems>
void flog_details ( OutputItem  message,
MoreItems &&...  more 
)

Recurse while there are arguments for flogging.

Here is the call graph for this function:

◆ flog_details() [2/2]

void flog_details ( void  )
inline

Implement empty argument list for flogging.

Here is the caller graph for this function:

◆ logging_enabled()

bool logging_enabled ( LOG_TYPE  level)
inline
Here is the caller graph for this function:

◆ set_logging()

void set_logging ( unsigned  logtype)
Here is the caller graph for this function:

◆ trim_filename()

static const char* trim_filename ( const char *  path)
inlinestatic

Variable Documentation

◆ flogging_level

LOG_TYPE flogging_level