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

using Log = LogType
 

Enumerations

enum class  LogType {
  ERROR = 0 , LOG_000 = 0x01 , LOG_100 = 0x02 , LOG_200 = 0x04 ,
  LOG_300 = 0x08 , LOG_400 = 0x10 , LOG_500 = 0x20 , GENERAL = 0x80 ,
  WARNING = 0x200 , QUEUE = 0x400 , USERACTION = 0x1000 , PROTOCOL = 0x2000 ,
  ALLOCATIONS = 0x4000 , CACHES = 0x8000 , TUNING = 0x10000 , BIASING = 0x20000 ,
  METADATA = 0x40000 , AUDIO = 0x80000 , PANDORA = 0x100000 , FILESYSTEM = 0x2000000
}
 

Functions

void set_logging (LogType logtype)
 Set the logging selections. More...
 
LogType get_logging ()
 
void flog_timestamp ()
 Logging helper subroutine to format and emit the time. More...
 
constexpr LogType operator| (const LogType a, const LogType b)
 Allow LogType values to be OR'ed together. More...
 
constexpr LogType operator& (const LogType a, const LogType b)
 Allow LogType values to be AND'ed apart. More...
 
constexpr LogType operator^ (const LogType a, const LogType b)
 Allow LogType values to be toggled. More...
 
constexpr LogType operator- (const LogType a, const LogType b)
 Allow LogType values to have bits removed.. More...
 
static const char * trim_filename (const char *path)
 
void flog_details (void)
 Implement empty argument list for flogging. More...
 
bool logging_enabled (LogType 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 (LogType level, MoreItems &&... more)
 Log messages when their logging category is enabled. More...
 

Variables

LogType flogging_level
 
bool flog_include_timestamp
 

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

using Log = LogType

Enumeration Type Documentation

◆ LogType

enum LogType
strong
Enumerator
ERROR 
LOG_000 
LOG_100 
LOG_200 
LOG_300 
LOG_400 
LOG_500 
GENERAL 
WARNING 
QUEUE 
USERACTION 
PROTOCOL 
ALLOCATIONS 
CACHES 
TUNING 

Tables of station rating averages for automatic station selection.

BIASING 

Tables of pick probabilities after applying ratings & recent biases.

METADATA 
AUDIO 
PANDORA 
FILESYSTEM 

Function Documentation

◆ flog()

template<typename... MoreItems>
void flog ( LogType  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:

◆ flog_timestamp()

void flog_timestamp ( )

Logging helper subroutine to format and emit the time.

Here is the caller graph for this function:

◆ get_logging()

LogType get_logging ( )
Here is the caller graph for this function:

◆ logging_enabled()

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

◆ operator&()

constexpr LogType operator& ( const LogType  a,
const LogType  b 
)
inlineconstexpr

Allow LogType values to be AND'ed apart.

◆ operator-()

constexpr LogType operator- ( const LogType  a,
const LogType  b 
)
inlineconstexpr

Allow LogType values to have bits removed..

◆ operator^()

constexpr LogType operator^ ( const LogType  a,
const LogType  b 
)
inlineconstexpr

Allow LogType values to be toggled.

◆ operator|()

constexpr LogType operator| ( const LogType  a,
const LogType  b 
)
inlineconstexpr

Allow LogType values to be OR'ed together.

◆ set_logging()

void set_logging ( LogType  logtype)

Set the logging selections.

Parameters
logtypeA bitfield indicating what events to log.
Here is the caller graph for this function:

◆ trim_filename()

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

Variable Documentation

◆ flog_include_timestamp

bool flog_include_timestamp
extern

◆ flogging_level

LogType flogging_level
extern