Custom formatter for flag 't', new Utils::GetThreadName()

This commit is contained in:
Vladyslav Baranovskyi
2024-05-30 16:30:09 +03:00
parent 2df5706df4
commit 3127af5bc7
4 changed files with 53 additions and 3 deletions

View File

@@ -10,6 +10,8 @@
#define SPDLOG_TRACE_ON
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/pattern_formatter.h>
namespace OpenVulkano
{
@@ -48,4 +50,12 @@ namespace OpenVulkano
static void RegisterSink(const spdlog::sink_ptr& newSink);
};
class CustomThreadNameFormatterFlag : public spdlog::custom_flag_formatter
{
public:
void format(const spdlog::details::log_msg &msg, const std::tm &tmTime, spdlog::memory_buf_t &dest) override;
std::unique_ptr<spdlog::custom_flag_formatter> clone() const override;
};
}