diff --git a/conanfile.py b/conanfile.py index acf9720..04d8559 100644 --- a/conanfile.py +++ b/conanfile.py @@ -26,7 +26,6 @@ class LightRecipe(ConanFile): self.requires("entt/3.15.0") self.requires("glfw/3.4") self.requires("glm/1.0.1") - self.requires("spdlog/1.15.3") self.requires("stb/cci.20240531") self.requires("yaml-cpp/0.8.0") self.requires("lz4/1.10.0") diff --git a/modules/input/CMakeLists.txt b/modules/input/CMakeLists.txt index 1ece084..f8aa62f 100644 --- a/modules/input/CMakeLists.txt +++ b/modules/input/CMakeLists.txt @@ -1,2 +1,2 @@ add_library_module(input input.cpp) -target_link_libraries(input PUBLIC spdlog::spdlog glm::glm imgui logger) +target_link_libraries(input PUBLIC glm::glm imgui logger) diff --git a/modules/logger/CMakeLists.txt b/modules/logger/CMakeLists.txt index d30eda2..73c7eaa 100644 --- a/modules/logger/CMakeLists.txt +++ b/modules/logger/CMakeLists.txt @@ -1,2 +1 @@ add_library_module(logger logger.cpp) -target_link_libraries(logger PUBLIC spdlog::spdlog) diff --git a/modules/logger/include/logger/logger.hpp b/modules/logger/include/logger/logger.hpp index 9bd9bf3..4dc5595 100644 --- a/modules/logger/include/logger/logger.hpp +++ b/modules/logger/include/logger/logger.hpp @@ -1,15 +1,9 @@ #pragma once #include -#include -#include -#include -#include +#include -/** @brief Severity of a log message. - * - * @note Values reflect spdlog::lvl - */ +/** Severity of a log message. */ enum class LogLvl : uint8_t { /** Lowest and most vebose log level, for tracing execution paths and events */ @@ -34,11 +28,7 @@ enum class LogLvl : uint8_t off = 6, }; -namespace spdlog { -class logger; -} - -/** Responsible for logging */ +/** Simple console logger */ class Logger { public: @@ -47,26 +37,19 @@ public: template void static log(LogLvl lvl, std::format_string fmt, Args &&...args) { - instance().spd_logger->log( - (spdlog::level::level_enum)lvl, - std::format(fmt, std::forward(args)...) - ); + std::ignore = lvl; + std::println(fmt, std::forward(args)...); } void static log(LogLvl lvl, const char *message) { - instance().spd_logger->log((spdlog::level::level_enum)lvl, message); + std::ignore = lvl; + std::println("{}", message); } private: - Logger(); - - ~Logger(); - - auto static instance() -> Logger &; - - std::shared_ptr spd_logger; + Logger() = default; }; template diff --git a/modules/logger/src/logger.cpp b/modules/logger/src/logger.cpp index 6fb4607..8910b00 100644 --- a/modules/logger/src/logger.cpp +++ b/modules/logger/src/logger.cpp @@ -1,18 +1 @@ #include - -Logger::Logger(): spd_logger(spdlog::stdout_color_mt("Logger")) -{ - spd_logger->set_pattern("%^%v%$"); - spd_logger->set_level(spdlog::level::level_enum::trace); -} - -Logger::~Logger() -{ - spdlog::drop_all(); -} - -auto Logger::instance() -> Logger & -{ - static auto logger = Logger {}; - return logger; -} diff --git a/modules/mirror/src/panel/asset_browser.cpp b/modules/mirror/src/panel/asset_browser.cpp index fe97920..3e4b051 100644 --- a/modules/mirror/src/panel/asset_browser.cpp +++ b/modules/mirror/src/panel/asset_browser.cpp @@ -154,7 +154,7 @@ void AssetBrowserPanel::on_user_interface_update() default: break; } // Label - ImGui::TextUnformatted(fmt::format("{}", path.filename().string()).c_str()); + ImGui::TextUnformatted(std::format("{}", path.filename().string()).c_str()); ImGui::PopID(); } diff --git a/modules/ui/CMakeLists.txt b/modules/ui/CMakeLists.txt index a4ac704..5108325 100644 --- a/modules/ui/CMakeLists.txt +++ b/modules/ui/CMakeLists.txt @@ -1,2 +1,2 @@ add_library_module(ui ui.cpp gl/ui.cpp) -target_link_libraries(ui PUBLIC spdlog::spdlog imgui renderer logger lt_debug) +target_link_libraries(ui PUBLIC imgui renderer logger lt_debug) diff --git a/tools/cmake/dependencies.cmake b/tools/cmake/dependencies.cmake index 5d4554f..56635ec 100644 --- a/tools/cmake/dependencies.cmake +++ b/tools/cmake/dependencies.cmake @@ -1,6 +1,5 @@ find_package(glfw3 REQUIRED) find_package(glm REQUIRED) -find_package(spdlog REQUIRED) find_package(stb REQUIRED) find_package(yaml-cpp REQUIRED) find_package(EnTT REQUIRED)