mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
SpdLog: fix compile error caused by undeclared function
SpdLog_Create() is no longer externed through its header as its a static internal function. Moved SpdLog_Create() above SpdLog_Init() to fix the compile error and rename it to SpdLog_CreateRotatingLoggers(), which is a more suitable name.
This commit is contained in:
parent
f49fbffa9a
commit
2a4516f3cb
@ -9,6 +9,40 @@ std::shared_ptr<spdlog::logger> g_SuppementalToolsLogger;
|
||||
std::ostringstream g_LogStream;
|
||||
std::shared_ptr<spdlog::sinks::ostream_sink_st> g_LogSink;
|
||||
|
||||
static void SpdLog_CreateRotatingLoggers()
|
||||
{
|
||||
/************************
|
||||
* ROTATE LOGGER SETUP *
|
||||
************************/
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("squirrel_re(warning)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "script_warning.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("squirrel_re"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "script.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "message.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk(warning)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "warning.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk(error)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "error.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("net_trace"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "net_trace.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
#ifndef DEDICATED
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("netconsole"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "netconsole.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
#endif // !DEDICATED
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("filesystem"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "filesystem.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
}
|
||||
|
||||
#ifdef _TOOLS
|
||||
// NOTE: used for tools as additional file logger on top of the existing terminal logger.
|
||||
void SpdLog_InstallSupplementalLogger(const char* pszLoggerName, const char* pszLogFileName, const char* pszPattern)
|
||||
{
|
||||
g_SuppementalToolsLogger = spdlog::basic_logger_mt(pszLoggerName, pszLogFileName);
|
||||
g_SuppementalToolsLogger->set_pattern(pszPattern);
|
||||
}
|
||||
#endif // _TOOLS
|
||||
|
||||
//#############################################################################
|
||||
// SPDLOG INIT
|
||||
//#############################################################################
|
||||
@ -61,7 +95,7 @@ void SpdLog_Init(const bool bAnsiColor)
|
||||
|
||||
#ifndef _TOOLS
|
||||
spdlog::set_default_logger(g_TermLogger); // Set as default.
|
||||
SpdLog_Create();
|
||||
SpdLog_CreateRotatingLoggers();
|
||||
#endif // !_TOOLS
|
||||
|
||||
spdlog::set_level(spdlog::level::trace);
|
||||
@ -75,37 +109,3 @@ void SpdLog_Shutdown()
|
||||
{
|
||||
spdlog::shutdown();
|
||||
}
|
||||
|
||||
void SpdLog_Create()
|
||||
{
|
||||
/************************
|
||||
* ROTATE LOGGER SETUP *
|
||||
************************/
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("squirrel_re(warning)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "script_warning.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("squirrel_re"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "script.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "message.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk(warning)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "warning.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("sdk(error)"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "error.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("net_trace"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "net_trace.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
#ifndef DEDICATED
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("netconsole"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "netconsole.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
#endif // !DEDICATED
|
||||
spdlog::rotating_logger_mt<spdlog::synchronous_factory>("filesystem"
|
||||
, fmt::format("{:s}\\{:s}", g_LogSessionDirectory, "filesystem.log"), SPDLOG_MAX_SIZE, SPDLOG_NUM_FILE)->set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v");
|
||||
}
|
||||
|
||||
#ifdef _TOOLS
|
||||
// NOTE: used for tools as additional file logger on top of the existing terminal logger.
|
||||
void SpdLog_InstallSupplementalLogger(const char* pszLoggerName, const char* pszLogFileName, const char* pszPattern)
|
||||
{
|
||||
g_SuppementalToolsLogger = spdlog::basic_logger_mt(pszLoggerName, pszLogFileName);
|
||||
g_SuppementalToolsLogger->set_pattern(pszPattern);
|
||||
}
|
||||
#endif // _TOOLS
|
||||
|
Loading…
x
Reference in New Issue
Block a user