Fixposition SDK 0.0.0-heads/main-0-g7b59b93
Collection of c++ libraries and apps for use with Fixposition products
|
Logging. More...
Classes | |
struct | LoggingParams |
Logging parameters. More... | |
Typedefs | |
using | LoggingPrintFunc = void (*)(const LoggingParams&, const LoggingLevel, const char*) |
Custom logging print function signature. | |
Enumerations | |
enum class | LoggingLevel { FATAL , ERROR , WARNING , NOTICE , INFO , DEBUG , TRACE } |
Logging verbosity levels, default is INFO. More... | |
enum class | LoggingColour { AUTO = 0 , YES , NO , JOURNAL } |
Logging "colours". More... | |
Functions | |
LoggingLevel & | operator++ (LoggingLevel &level) |
Increase verbosity (pre-increment) | |
LoggingLevel & | operator-- (LoggingLevel &level) |
Decrease verbosity (pre-decrement) | |
LoggingLevel | operator++ (LoggingLevel &level, int) |
Increase verbosity (post-increment) | |
LoggingLevel | operator-- (LoggingLevel &level, int) |
Decrease verbosity (post-decrement) | |
const char * | LoggingLevelStr (const LoggingLevel level) |
Stringify log level. | |
bool | LoggingIsLevel (const LoggingLevel level) |
Check if given level would print. | |
LoggingParams | LoggingSetParams (const LoggingParams ¶ms) |
Configure logging. | |
LoggingParams | LoggingGetParams () |
Get current logging params. | |
void | LoggingPrint (const LoggingLevel level, const char *fmt,...) PRINTF_ATTR(2) |
Print a log message. | |
void | LoggingHexdump (const LoggingLevel level, const uint8_t *data, const uint64_t size, const char *prefix, const char *fmt,...) PRINTF_ATTR(5) |
Print a hexdump. | |
Logging.
using fpsdk::common::logging::LoggingPrintFunc = void (*)(const LoggingParams&, const LoggingLevel, const char*) |
Custom logging print function signature.
Definition at line 201 of file logging.hpp.
|
strong |
Logging verbosity levels, default is INFO.
The logging levels loosely follow syslog levels (indicated in [] below, see also https://en.wikipedia.org/wiki/Syslog)
Libraries (fpsdk_common, fpsdk_ros1, ...) code shall only use WARNING and DEBUG.
Definition at line 151 of file logging.hpp.
|
strong |
Logging "colours".
Definition at line 188 of file logging.hpp.
const char * fpsdk::common::logging::LoggingLevelStr | ( | const LoggingLevel | level | ) |
Stringify log level.
[in] | level | The logging level |
bool fpsdk::common::logging::LoggingIsLevel | ( | const LoggingLevel | level | ) |
Check if given level would print.
[in] | level | The logging level in question |
LoggingParams fpsdk::common::logging::LoggingSetParams | ( | const LoggingParams & | params | ) |
Configure logging.
[in] | params | Logging parameters |
Examples:
LoggingParams fpsdk::common::logging::LoggingGetParams | ( | ) |
Get current logging params.
void fpsdk::common::logging::LoggingPrint | ( | const LoggingLevel | level, |
const char * | fmt, | ||
... ) |
void fpsdk::common::logging::LoggingHexdump | ( | const LoggingLevel | level, |
const uint8_t * | data, | ||
const uint64_t | size, | ||
const char * | prefix, | ||
const char * | fmt, | ||
... ) |
Print a hexdump.
[in] | level | Logging level |
[in] | data | Pointer to start of data to dump |
[in] | size | Size of data to dump |
[in] | prefix | Prefix to add to each line, can be NULL to omit |
[in] | fmt | printf() style format string (for a first line to print), can be NULL to omit |
[in] | ... | Arguments to the format string |