mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
lite wip
This commit is contained in:
13
lite-example/CMakeLists.txt
Normal file
13
lite-example/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
project(spdlog-lite-example CXX)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(LITE_SOURCES example.cpp create_lite.cpp)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${LITE_SOURCES})
|
||||
|
||||
include_directories(../lite)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE spdlog_lite)
|
||||
|
||||
|
15
lite-example/create_lite.cpp
Normal file
15
lite-example/create_lite.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "logger.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
|
||||
spdlog::lite::logger spdlog::create_lite(void* ctx)
|
||||
{
|
||||
if(ctx) {
|
||||
//..
|
||||
}
|
||||
auto logger_impl = spdlog::default_logger();
|
||||
logger_impl->set_level(spdlog::level::trace);
|
||||
return spdlog::lite::logger(logger_impl);
|
||||
}
|
||||
|
||||
|
7
lite-example/example.cpp
Normal file
7
lite-example/example.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "logger.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
auto l = spdlog::create_lite();
|
||||
l.trace("HELLO {}!!!", "lite");
|
||||
}
|
Reference in New Issue
Block a user