110b7ffca8
BREAKING CHANGE: stk_log() signature changed to require log level - Add log levels (ERROR, WARN, INFO, DEBUG) with runtime filtering - Add timestamps (yyyy-mm-dd HH:MM:SS.mmm format) - Add stk_set_log_output(), stk_set_log_prefix(), stk_set_log_level() - Platform-specific timestamp: GetLocalTime (Windows), gettimeofday (POSIX) - Consolidate duplicate platform includes into POSIX common block - Setting log output to NULL disables logging. Default: INFO level, "stk" prefix, stdout output. All internal messages use appropriate severity levels. Single byte flag controls enable/disable.
28 lines
437 B
C
28 lines
437 B
C
#ifndef STK_LOG_H
|
|
#define STK_LOG_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
STK_LOG_ERROR,
|
|
STK_LOG_WARN,
|
|
STK_LOG_INFO,
|
|
STK_LOG_DEBUG
|
|
} stk_log_level_t;
|
|
|
|
void stk_set_log_output(FILE *fp);
|
|
void stk_set_log_prefix(const char *prefix);
|
|
void stk_set_log_level(stk_log_level_t min_level);
|
|
|
|
void stk_log(stk_log_level_t level, const char *fmt, ...);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* STK_LOG_H */
|