Comms CCF
This is a simple communication layer based on COBS, CBOR and FNV-1A
Loading...
Searching...
No Matches
ndebug.hpp File Reference

Go to the source code of this file.

Macros

#define debugf(...)
#define LOGLEVEL_ARGS
#define DEBUG
 Debug levels at the start of debugf.
#define INFO
#define WARN
#define ERROR
#define END
 Terminator of log message at the end.

Functions

void ignoreVarArgs (...)

Detailed Description

The common debug ignore macros. If including this in a header, don't forget to:

Macro Definition Documentation

◆ debugf

#define debugf ( ...)
Value:
([&]{ if constexpr (false) { ignoreVarArgs(__VA_ARGS__); } }())
void ignoreVarArgs(...)

Need an expression that contains parameters for parameter pack Want to avoid linking printf at any optimisation, hence the constexpr if Want an expression not a statement, hence the lambda wrapper

◆ LOGLEVEL_ARGS

#define LOGLEVEL_ARGS

Start of debug printing format arguments – always specify when using DEBUG/INFO/WARN/ERROR

Function Documentation

◆ ignoreVarArgs()

void ignoreVarArgs ( ...)
extern

Note: no #pragma once because we #undefine debugf at the ends of headers to be able to use debugf inside header code