You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spdlog/lite-example/create_lite.cpp

20 lines
538 B
C++

7 years ago
#include "spdlite.h"
7 years ago
#include "spdlog/spdlog.h"
7 years ago
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
7 years ago
7 years ago
spdlog::lite::logger spdlog::create_lite(void *ctx)
7 years ago
{
7 years ago
if (ctx)
{
7 years ago
//..
}
7 years ago
auto logger_impl = spdlog::stdout_color_mt("mylogger");
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("file.txt", true);
logger_impl->sinks().push_back(file_sink);
logger_impl->set_level(spdlog::level::debug);
return spdlog::lite::logger(std::move(logger_impl));
7 years ago
}