YATL
Loading...
Searching...
No Matches
Logging

Logging macros and utilities. More...

Macros

#define YATL_ENABLE_LOGGING
 Enable YATL logging.
#define YATL_LOG(level, fmt, ...)
 Log a message with level, file, line, and function context.

Enumerations

enum  YATL_log_level_t { YATL_LOG_DEBUG , YATL_LOG_INFO , YATL_LOG_WARN , YATL_LOG_ERROR }
 Log levels for YATL diagnostic messages. More...

Detailed Description

Logging macros and utilities.

Macro Definition Documentation

◆ YATL_LOG

#define YATL_LOG ( level,
fmt,
... )
Value:
do { \
if ((level) >= LOG_LEVEL) { \
fprintf(stderr, "[%s] %s:%d (%s): " fmt "\n", log_level_str(level), \
__FILE__, __LINE__, __func__, ##__VA_ARGS__); \
} \
} while (0)

Log a message with level, file, line, and function context.

Parameters
levelLog level (YATL_LOG_DEBUG, YATL_LOG_INFO, etc.)
fmtPrintf-style format string
...Format arguments

Enumeration Type Documentation

◆ YATL_log_level_t

Log levels for YATL diagnostic messages.

Enumerator
YATL_LOG_DEBUG 

Debug-level messages

YATL_LOG_INFO 

Informational messages

YATL_LOG_WARN 

Warning messages

YATL_LOG_ERROR 

Error messages