first commit

This commit is contained in:
st committed 2026-08-09 16:51:01 -05:00
commit 7349b743e3
21 files changed
+1527

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <string>
#include <functional>
enum class LogTag { Info, Ok, Warn, Err };
// Thread-safe console logger (stand-in for the python `push_log` + log_queue/SSE).
// Also supports a "sink" callback so the Discord bot can mirror log lines into
// a Discord channel/log command without polling a queue.
class Logger {
public:
using Sink = std::function<void(const std::string& ts, const std::string& msg, LogTag tag)>;
static void log(const std::string& msg, LogTag tag = LogTag::Info);
static void setSink(Sink sink);
private:
static Sink sink_;
};