refactor: extract logger to separate module
This commit is contained in:
parent
2341be0c70
commit
d8f656d98b
7 changed files with 9 additions and 11 deletions
|
@ -1,3 +1,5 @@
|
|||
add_subdirectory(./logger)
|
||||
|
||||
add_subdirectory(./asset_baker)
|
||||
add_subdirectory(./asset_parser)
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ if(NOT WIN32)
|
|||
core/uuid.cpp
|
||||
debug/exceptions.cpp
|
||||
debug/instrumentor.cpp
|
||||
debug/logger.cpp
|
||||
graphics/blender.cpp
|
||||
graphics/buffers.cpp
|
||||
graphics/framebuffer.cpp
|
||||
|
@ -53,7 +52,6 @@ else()
|
|||
core/uuid.cpp
|
||||
debug/exceptions.cpp
|
||||
debug/instrumentor.cpp
|
||||
debug/logger.cpp
|
||||
graphics/blender.cpp
|
||||
graphics/buffers.cpp
|
||||
graphics/framebuffer.cpp
|
||||
|
@ -102,9 +100,9 @@ endif()
|
|||
target_link_libraries(
|
||||
engine
|
||||
PUBLIC glad
|
||||
PUBLIC logger
|
||||
PUBLIC opengl::opengl
|
||||
PUBLIC glfw
|
||||
PUBLIC spdlog::spdlog
|
||||
PUBLIC imgui
|
||||
PUBLIC stb::stb
|
||||
PUBLIC yaml-cpp::yaml-cpp
|
||||
|
|
|
@ -95,7 +95,7 @@ auto linux_only(auto value)
|
|||
{ \
|
||||
if (!(x)) \
|
||||
{ \
|
||||
log_crt(__VA_ARGS__); \
|
||||
log_crt(__VA_ARGS__); \
|
||||
lt_debug_trap(); \
|
||||
throw ::Light::FailedAssertion(__FILE__, __LINE__); \
|
||||
} \
|
||||
|
@ -122,7 +122,7 @@ constexpr auto bit(auto x)
|
|||
|
||||
/* debug */
|
||||
#ifndef LIGHT_LOGGER_H
|
||||
#include <engine/debug/logger.hpp>
|
||||
#include <logger/logger.hpp>
|
||||
#endif
|
||||
#include <engine/debug/exceptions.hpp>
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <engine/camera/camera.hpp>
|
||||
|
||||
// debug
|
||||
#include <engine/debug/logger.hpp>
|
||||
#include <logger/logger.hpp>
|
||||
|
||||
// events
|
||||
#include <engine/events/char.hpp>
|
||||
|
|
2
modules/logger/CMakeLists.txt
Normal file
2
modules/logger/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
add_library_module(logger logger.cpp)
|
||||
target_link_libraries(logger PUBLIC spdlog::spdlog)
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <any>
|
||||
#include <format>
|
||||
#include <memory>
|
||||
#include <spdlog/sinks/basic_file_sink.h>
|
|
@ -1,7 +1,4 @@
|
|||
#include <engine/debug/logger.hpp>
|
||||
#include <spdlog/sinks/basic_file_sink.h>
|
||||
#include <spdlog/sinks/stdout_color_sinks.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <logger/logger.hpp>
|
||||
|
||||
Logger::Logger(): spd_logger(spdlog::stdout_color_mt("Logger"))
|
||||
{
|
Loading…
Add table
Reference in a new issue