feat(logging)!: add enhanced logging system

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.
This commit is contained in:
2026-02-14 16:59:56 +01:00
parent 26fb19a7f5
commit 110b7ffca8
5 changed files with 135 additions and 29 deletions
+1
View File
@@ -5,6 +5,7 @@
#include <stdlib.h>
/* Buffers */
#define STK_LOG_PREFIX_BUFFER 64
#define STK_MOD_DIR_BUFFER 256
#define STK_MOD_ID_BUFFER 64
#define STK_PATH_MAX 256