aboutsummaryrefslogtreecommitdiff
path: root/src/Platform.h
diff options
context:
space:
mode:
authorJesse Talavera-Greenberg <jesse@jesse.tg>2023-03-23 13:04:38 -0400
committerGitHub <noreply@github.com>2023-03-23 18:04:38 +0100
commit79dfb8dc8f356834f0b6cf7baf73f77552b08923 (patch)
tree9a2a139617b8e178edd153ac68d56f2d0e48e3ed /src/Platform.h
parent19280cff2d3d618f032d0e6ef4b1d4414fa02f58 (diff)
Introduce `Platform::Log` (#1640)
* Add Platform::Log and Platform::LogLevel * Replace most printf calls with Platform::Log calls * Move a brace down * Move some log entries to one Log call - Some implementations of Log may assume a full line * Log the MAC address as LogLevel::Info
Diffstat (limited to 'src/Platform.h')
-rw-r--r--src/Platform.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Platform.h b/src/Platform.h
index f2997ef..2227ffc 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -128,6 +128,16 @@ inline bool LocalFileExists(std::string name)
return true;
}
+enum LogLevel
+{
+ Debug,
+ Info,
+ Warn,
+ Error,
+};
+
+void Log(LogLevel level, const char* fmt, ...);
+
struct Thread;
Thread* Thread_Create(std::function<void()> func);
void Thread_Free(Thread* thread);