|
libPeConv
A library to load, manipulate, dump PE files.
|
Compile-time configurable logging macros for peconv. More...
#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | LOG_LEVEL_NONE 0 |
| #define | LOG_LEVEL_ERROR 1 |
| #define | LOG_LEVEL_WARNING 2 |
| #define | LOG_LEVEL_INFO 3 |
| #define | LOG_LEVEL_DEBUG 4 |
| #define | LOG_VERBOSITY LOG_LEVEL_ERROR |
| #define | _LOG(tag, fmt, ...) |
| #define | LOG_ERROR(fmt, ...) _LOG("ERROR", fmt, ##__VA_ARGS__) |
| #define | LOG_WARNING(fmt, ...) do {} while(0) |
| #define | LOG_INFO(fmt, ...) do {} while(0) |
| #define | LOG_DEBUG(fmt, ...) do {} while(0) |
Compile-time configurable logging macros for peconv.
Verbosity is controlled at compile time via the LOG_VERBOSITY preprocessor symbol. Any message whose level exceeds LOG_VERBOSITY is compiled out entirely — no runtime overhead, no branch, no string literal in the binary.
By default messages are written to stderr. Define LOG_USE_DEBUGOUT before including this header (or via the build system) to redirect output to the Windows debugger via OutputDebugStringA instead.
Typical build-system usage:
Definition in file logger.h.
| #define _LOG | ( | tag, | |
| fmt, | |||
| ... | |||
| ) |
| #define LOG_ERROR | ( | fmt, | |
| ... | |||
| ) | _LOG("ERROR", fmt, ##__VA_ARGS__) |
| #define LOG_VERBOSITY LOG_LEVEL_ERROR |