|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | logStr(level, str) _logStr_##level(LOG_##level, LogDefault, str) |
| #define | logStrC(level, cat, str) _logStr_##level(LOG_##level, cat, str) |
| #define | logFmt(level, fmt, ...) |
| #define | logFmtC(level, cat, fmt, ...) |
These macros provide the primary interface for logging messages. They compile to no-ops for levels that are disabled based on DEBUG_LEVEL, ensuring zero overhead for disabled log levels.
Debug Level Filtering:
DEBUG_LEVEL >= 2: All levels including TraceDEBUG_LEVEL >= 1: Debug and above (no Trace)DEBUG_LEVEL == 0: Diag and above (no Debug or Trace)Dev variants: The Dev prefix variants (e.g., logStr(DevInfo, ...)) are only compiled in development builds and map to their corresponding regular levels in production.
| #define logFmt | ( | level, | |
| fmt, | |||
| ... | |||
| ) |
Log a formatted message using the default category
| level | Log level without LOG_ prefix (e.g., Info, Warn, Error) |
| fmt | Format string (see Formatting for format syntax) |
| ... | Format arguments wrapped in stvar() |
| #define logFmtC | ( | level, | |
| cat, | |||
| fmt, | |||
| ... | |||
| ) |
void logFmtC(level, cat, fmt, ...)
Log a formatted message with a specific category
| level | Log level without LOG_ prefix |
| cat | LogCategory pointer |
| fmt | Format string |
| ... | Format arguments wrapped in stvar() LogCategory * logCreateCat(strref name, bool priv) Definition log.h:81 |
| #define logStr | ( | level, | |
| str | |||
| ) | _logStr_##level(LOG_##level, LogDefault, str) |
void logStr(level, str)
Log a string message using the default category
| level | Log level without LOG_ prefix (e.g., Info, Warn, Error) |
| str | String or string reference to log |
| #define logStrC | ( | level, | |
| cat, | |||
| str | |||
| ) | _logStr_##level(LOG_##level, cat, str) |
Log a string message with a specific category
| level | Log level without LOG_ prefix (e.g., Info, Warn, Error) |
| cat | LogCategory pointer |
| str | String or string reference to log |