mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
wip lite
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// Copyright(c) 2015-present Gabi Melman.
|
||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||
|
||||
#include "spdlite.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
#include "spdlog/sinks/stdout_sinks.h"
|
||||
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
@@ -10,5 +12,5 @@
|
||||
spdlite::logger create_logger(void *ctx)
|
||||
{
|
||||
UNUSED(ctx);
|
||||
return spdlite::default_logger();
|
||||
return spdlite::logger(spdlog::basic_logger_mt("logger-name", "log.txt", true));
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#include "spdlite.h"
|
||||
// Copyright(c) 2015-present Gabi Melman.
|
||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||
|
||||
#include "spdlite.h"
|
||||
#include "spdlite_global.h"
|
||||
|
||||
#define SPDLITE_ACTIVE_LEVEL SPDLITE_LEVEL_TRACE
|
||||
#include "spdlite_macros.h"
|
||||
int main()
|
||||
{
|
||||
spdlite::default_logger().set_level(spdlite::level::trace);
|
||||
spdlite::trace_printf("Hello %d", 123);
|
||||
spdlite::debug_printf("Hello %d", 123);
|
||||
spdlite::info_printf("Hello %d", 123);
|
||||
spdlite::warn_printf("Hello %d", 123);
|
||||
spdlite::error_printf("Hello %d", 123);
|
||||
spdlite::critical_printf("Hello %d", 123);
|
||||
{
|
||||
SPDLITE_TRACE("SOME INFO {}", 123);
|
||||
}
|
Reference in New Issue
Block a user