// Log window: shows the log lines the injected hook streams over the shared log // ring (see coop/log_ring.hpp). Pull new lines each frame from the IPC server, // keep a bounded rolling history, and render them with autoscroll + a filter. #pragma once #include #include #include #include "coop/log_ring.hpp" namespace coop { class InjectionPanel; class LogPanel { public: // Pull any new lines the hook emitted (call once per frame before draw()). void pull(InjectionPanel& injection); void draw(); private: void add_line(const LogRecord& rec); struct Line { std::string text; std::uint32_t level; // LogLevel, for colouring }; std::deque lines_; char filter_[96] = {}; bool autoscroll_ = true; std::uint64_t first_millis_ = 0; // hook clock at the first line, for relative timestamps static constexpr std::size_t kMaxLines = 2000; }; } // namespace coop