#pragma once #include #include #include #include "gui/components/wxLogCtrl.h" class wxLogEvent; class LoggingWindow : public wxFrame { public: LoggingWindow(wxFrame* parent); ~LoggingWindow(); static void Log(std::string_view filter, std::string_view message); static void Log(std::string_view message) { Log("", message); } static void Log(std::string_view filter, std::wstring_view message); static void Log(std::wstring_view message){ Log("", message); } template static void Log(std::string_view filter, std::string_view format, TArgs&&... args) { Log(filter, fmt::format(format, std::forward(args)...)); } template static void Log(std::string_view filter, std::wstring_view format, TArgs&&... args) { Log(filter, fmt::format(format, std::forward(args)...)); } private: void OnLogMessage(wxLogEvent& event); void OnFilterChange(wxCommandEvent& event); void OnFilterMessageChange(wxCommandEvent& event); wxComboBox* m_filter; wxLogCtrl* m_log_list; wxCheckBox* m_filter_message; inline static std::shared_mutex s_mutex; inline static LoggingWindow* s_instance = nullptr; };