2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
2023-05-10 00:05:38 +02:00
|
|
|
#include <sstream>
|
|
|
|
#include "thirdparty/spdlog/spdlog.h"
|
|
|
|
#include "thirdparty/spdlog/async.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/ostream_sink.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/basic_file_sink.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/stdout_sinks.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/stdout_color_sinks.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/ansicolor_sink.h"
|
|
|
|
#include "thirdparty/spdlog/sinks/rotating_file_sink.h"
|
|
|
|
|
2022-01-20 00:41:00 +01:00
|
|
|
constexpr int SPDLOG_MAX_SIZE = 10 * 1024 * 1024; // Sets number of bytes before rotating logger.
|
2023-03-26 17:47:42 +02:00
|
|
|
constexpr int SPDLOG_NUM_FILE = 512; // Sets number of files to rotate to.
|
2022-01-14 20:45:36 +01:00
|
|
|
|
|
|
|
inline bool g_bSpdLog_UseAnsiClr = false;
|
2022-09-14 00:39:38 +02:00
|
|
|
inline bool g_bSpdLog_PostInit = false;
|
2022-01-14 20:45:36 +01:00
|
|
|
|
2023-03-27 02:01:48 +02:00
|
|
|
extern std::shared_ptr<spdlog::logger> g_TermLogger;
|
|
|
|
extern std::shared_ptr<spdlog::logger> g_ImGuiLogger;
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
2022-01-14 20:45:36 +01:00
|
|
|
// IMGUI CONSOLE SINK |
|
2023-06-18 23:55:58 +02:00
|
|
|
extern std::ostringstream g_LogStream;
|
|
|
|
extern std::shared_ptr<spdlog::sinks::ostream_sink_st> g_LogSink;
|
2022-01-14 20:45:36 +01:00
|
|
|
|
|
|
|
void SpdLog_Init(void);
|
2023-03-27 02:01:48 +02:00
|
|
|
void SpdLog_Create(void);
|
2022-06-20 15:48:33 +02:00
|
|
|
void SpdLog_PostInit(void);
|
2023-03-18 14:10:29 +01:00
|
|
|
void SpdLog_Shutdown(void);
|