54 return static_cast <LogType> (
static_cast <unsigned> (a) |
static_cast <unsigned> (b));
59 return static_cast <LogType> (
static_cast <unsigned> (a) &
static_cast <unsigned> (b));
64 return static_cast <LogType> (
static_cast <unsigned> (a) ^
static_cast <unsigned> (b));
69 return static_cast <LogType> (
static_cast <unsigned> (a) & ~
static_cast <unsigned> (b));
74 const char *name = strrchr (path,
'/');
75 return name ? name + 1 : path;
83 #define LOG_WHERE(level) (level)
84 #define LOG_FUNCTION(level) (level), __func__, ": "
86 #define LOG_WHERE(level) (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "
87 #define LOG_FUNCTION(level) (level), trim_filename(__FILE__), ":", __LINE__, " ", __func__, " (", #level, "): "
92 std::clog << std::endl;
96 return (level == Log::ERROR ||
static_cast <unsigned> (
flogging_level & level));
100 template<
typename OutputItem,
typename... MoreItems>
102 std::clog << message;
108 template<
typename... MoreItems>
void flog(LogType level, MoreItems &&... more)
Log messages when their logging category is enabled.
Definition: logging.h:109
constexpr LogType operator-(const LogType a, const LogType b)
Allow LogType values to have bits removed..
Definition: logging.h:68
void flog_timestamp()
Logging helper subroutine to format and emit the time.
Definition: logging.cpp:28
constexpr LogType operator|(const LogType a, const LogType b)
Allow LogType values to be OR'ed together.
Definition: logging.h:53
static const char * trim_filename(const char *path)
Definition: logging.h:73
bool logging_enabled(LogType level)
Definition: logging.h:95
void flog_details(void)
Implement empty argument list for flogging.
Definition: logging.h:91
constexpr LogType operator^(const LogType a, const LogType b)
Allow LogType values to be toggled.
Definition: logging.h:63
LogType flogging_level
Definition: logging.cpp:13
bool flog_include_timestamp
Definition: logging.cpp:14
void set_logging(LogType logtype)
Set the logging selections.
Definition: logging.cpp:18
constexpr LogType operator&(const LogType a, const LogType b)
Allow LogType values to be AND'ed apart.
Definition: logging.h:58
LogType get_logging()
Definition: logging.cpp:22
LogType
Definition: logging.h:18
@ TUNING
Tables of station rating averages for automatic station selection.
@ BIASING
Tables of pick probabilities after applying ratings & recent biases.