clutchlog  0.5.0
Macros
High-level API macros

Macros

#define CLUTCHLOC   __FILE__, __FUNCTION__, __LINE__
 Handy shortcuts to location.
 
#define CLUTCHLOG(LEVEL, WHAT)
 Log a message at the given level. More...
 
#define CLUTCHDUMP(LEVEL, CONTAINER, FILENAME)
 Dump the given container. More...
 
#define CLUTCHFUNC(LEVEL, FUNC, ...)
 Call an assert at the given level. More...
 

Detailed Description

Macro Definition Documentation

◆ CLUTCHDUMP

#define CLUTCHDUMP (   LEVEL,
  CONTAINER,
  FILENAME 
)
Value:
{ \
auto& logger = clutchlog::logger(); \
logger.dump(clutchlog::level::LEVEL, std::begin(CONTAINER), std::end(CONTAINER), \
}
#define CLUTCHLOC
Handy shortcuts to location.
Definition: clutchlog.h:83
static clutchlog & logger()
Get the logger instance.
Definition: clutchlog.h:165
#define CLUTCHDUMP_DEFAULT_SEP
Default item separator for dump.
Definition: clutchlog.h:64

Dump the given container.

◆ CLUTCHFUNC

#define CLUTCHFUNC (   LEVEL,
  FUNC,
  ... 
)
Value:
{ \
auto& logger = clutchlog::logger(); \
clutchlog::scope_t scope = logger.locate(clutchlog::level::LEVEL, CLUTCHLOC); \
if(scope.matches) { \
FUNC(__VA_ARGS__); \
} \
}
#define CLUTCHLOC
Handy shortcuts to location.
Definition: clutchlog.h:83
static clutchlog & logger()
Get the logger instance.
Definition: clutchlog.h:165

Call an assert at the given level.

◆ CLUTCHLOG

#define CLUTCHLOG (   LEVEL,
  WHAT 
)
Value:
{ \
auto& logger = clutchlog::logger(); \
std::ostringstream msg ; msg << WHAT; \
logger.log(clutchlog::level::LEVEL, msg.str(), CLUTCHLOC); \
}
#define CLUTCHLOC
Handy shortcuts to location.
Definition: clutchlog.h:83
static clutchlog & logger()
Get the logger instance.
Definition: clutchlog.h:165

Log a message at the given level.