|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "fmt/format.h"
|
|
|
|
|
|
|
|
|
|
#include "DllDefines.h"
|
|
|
|
|
|
|
|
|
|
#ifdef LEGACY_LOGGER
|
|
|
|
|
#include "LegacyDebugLog.h"
|
|
|
|
|
#include "LegacyDebugLogTiming.h"
|
|
|
|
|
#include "LegacyGuiEventLog.h"
|
|
|
|
|
|
|
|
|
|
extern UTILITYDLL CLegacyDebugLog mitechDebug;
|
|
|
|
|
extern UTILITYDLL CLegacyDebugLogTiming mitechDebugLogTiming;
|
|
|
|
|
extern UTILITYDLL CLegacyGuiEventLog mitechGuiEventLog;
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
|
|
|
|
|
|
#include "LogManager.h"
|
|
|
|
|
|
|
|
|
|
using namespace mitech::utils::logging;
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void TraceLog(fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_LOG).Trace(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void InfoLog(fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_LOG).Info(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void DebugLog(fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_LOG).Log(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void DebugLogTrace(bool bTraceData, fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
if (bTraceData)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_LOG).Log(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void DebugLogError(bool bTraceData, fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
if (bTraceData)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_LOG).Error(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void DebugLogTiming(fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_TIMING_LOG).Log(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void DebugLogTimingTrace(bool bTraceData, fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
if (bTraceData)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::DEBUG_TIMING_LOG).Log(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
|
void GUIEventLog(fmt::format_string<Args...> _fmt, Args&&... args)
|
|
|
|
|
{
|
|
|
|
|
CLoggerManagerSingleton::Instance().LoggerManager().GetLogger(eLOGGER::GUI_EVENT_LOG).Log(_fmt, args...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<spdlog::logger> UTILITYDLL GetLogger(const std::string& strName);
|
|
|
|
|
|
|
|
|
|
// on demand flush to file
|
|
|
|
|
void UTILITYDLL FlushDebugLog();
|
|
|
|
|
|
|
|
|
|
void UTILITYDLL FlushDebugLogTiming();
|
|
|
|
|
|
|
|
|
|
void UTILITYDLL FlushGuiEventLog();
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
void UTILITYDLL ShutdownLogging();
|
|
|
|
|
|
|
|
|
|
void UTILITYDLL StartDebugLog();
|
|
|
|
|
void UTILITYDLL StopDebugLog();
|
|
|
|
|
|
|
|
|
|
void UTILITYDLL StartDebugTimingLog();
|
|
|
|
|
void UTILITYDLL StopDebugTimingLog();
|
|
|
|
|
|
|
|
|
|
bool UTILITYDLL IsDebugLogStarted();
|
|
|
|
|
bool UTILITYDLL IsDebugLogTimingStarted();
|
|
|
|
|
|
|
|
|
|
// All GUI Activities Events Log
|
|
|
|
|
void UTILITYDLL StartGUIEventLog();
|
|
|
|
|
void UTILITYDLL StopGUIEventLog();
|