From 3075902140ef7c68da47ea36a82f5b161faf5fa8 Mon Sep 17 00:00:00 2001 From: max Date: Sat, 1 Feb 2025 01:23:38 +0100 Subject: [PATCH] Logging implementation basics --- .vscode/settings.json | 5 ++++- src/net/include/log.h | 15 +++++++++++++++ src/net/logging/log.c | 10 +++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0876307..37b1354 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "task.problemMatchers.neverPrompt": true + "task.problemMatchers.neverPrompt": true, + "files.associations": { + "log.h": "c" + } } \ No newline at end of file diff --git a/src/net/include/log.h b/src/net/include/log.h index acfea1c..ae07929 100755 --- a/src/net/include/log.h +++ b/src/net/include/log.h @@ -1,6 +1,21 @@ #ifndef LOG_H #define LOG_H +typedef enum log_severity +{ + Verbose, + Debug, + Info, + Warning, + Error, + Fatal +} LogSeverity; + +struct log_info +{ + LogSeverity serverity; + char* message; +}; #endif //LOG_H diff --git a/src/net/logging/log.c b/src/net/logging/log.c index 8979ac1..399fb72 100755 --- a/src/net/logging/log.c +++ b/src/net/logging/log.c @@ -1,2 +1,10 @@ #include "netex.h" -#include "log.h" \ No newline at end of file +#include "log.h" + +void initialize_logger(void) +{ + // Setup outputs (file, console) + // Create log queue + // Create log thread + // Start log thread +} \ No newline at end of file