Skip to content

Commit

Permalink
[spdlog] Small spdlog format improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmNotHanni committed Apr 20, 2020
1 parent 0ff85d0 commit f125e72
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions example/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <spdlog/spdlog.h>
#include <inexor_application.hpp>
#include <spdlog/async.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <inexor_application.hpp>
#include <spdlog/sinks/stdout_color_sinks.h>

using namespace inexor::vulkan_renderer;

Expand All @@ -13,9 +13,10 @@ int main(int argc, char *argv[]) {

auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("vulkan-renderer.log", true);
auto vulkan_renderer_log = std::make_shared<spdlog::async_logger>("vulkan-renderer", spdlog::sinks_init_list{console_sink, file_sink}, spdlog::thread_pool(), spdlog::async_overflow_policy::block);
auto vulkan_renderer_log = std::make_shared<spdlog::async_logger>("vulkan-renderer", spdlog::sinks_init_list{console_sink, file_sink},
spdlog::thread_pool(), spdlog::async_overflow_policy::block);
vulkan_renderer_log->set_level(spdlog::level::trace);
vulkan_renderer_log->set_pattern("%Y-%m-%d %T.%f [%-8l] [%5P] [%5t] [%-10n] %v");
vulkan_renderer_log->set_pattern("%Y-%m-%d %T.%f %^%l%$ %5P %5t [%-10n] %v");
vulkan_renderer_log->flush_on(spdlog::level::debug); // TODO: as long as we don't have a flush on crash

spdlog::set_default_logger(vulkan_renderer_log);
Expand Down

0 comments on commit f125e72

Please sign in to comment.