mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 02:19:35 +08:00
Moved lite source to folders|
This commit is contained in:
11
spdlite/example/CMakeLists.txt
Normal file
11
spdlite/example/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
project(spdlite-example CXX)
|
||||
|
||||
set(LITE_SOURCES example.cpp create_logger.cpp)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${LITE_SOURCES})
|
||||
|
||||
find_package(Threads)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE spdlite)
|
||||
|
||||
|
16
spdlite/example/create_logger.cpp
Normal file
16
spdlite/example/create_logger.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright(c) 2015-present Gabi Melman.
|
||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||
|
||||
#include "spdlite/spdlite.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
// example of creating lite logger with console and file sink
|
||||
spdlite::logger create_logger(void *ctx)
|
||||
{
|
||||
UNUSED(ctx);
|
||||
return spdlite::logger(spdlog::basic_logger_mt("logger-name", "log.txt", true));
|
||||
}
|
12
spdlite/example/example.cpp
Normal file
12
spdlite/example/example.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright(c) 2015-present Gabi Melman.
|
||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||
|
||||
#include "spdlite/spdlite.h"
|
||||
#include "spdlite/spdlite_global.h"
|
||||
|
||||
#define SPDLITE_ACTIVE_LEVEL SPDLITE_LEVEL_TRACE
|
||||
#include "spdlite/spdlite_macros.h"
|
||||
int main()
|
||||
{
|
||||
SPDLITE_TRACE("SOME INFO {}", 123);
|
||||
}
|
Reference in New Issue
Block a user