mirror of
https://github.com/AxioDL/LibCommon.git
synced 2026-03-30 11:47:23 -07:00
55b88dac24
Reduces dependency on TString.
46 lines
887 B
C++
46 lines
887 B
C++
#ifndef AXIO_LOG_H
|
|
#define AXIO_LOG_H
|
|
|
|
#include <spdlog/spdlog.h>
|
|
#include <string>
|
|
|
|
/** Application logging functionality */
|
|
namespace NLog
|
|
{
|
|
|
|
bool InitLog(const std::string& filename);
|
|
|
|
inline auto Get()
|
|
{
|
|
return spdlog::get("axio");
|
|
}
|
|
|
|
template <typename... Args>
|
|
void Debug(spdlog::format_string_t<Args...> fmt, Args&&... args)
|
|
{
|
|
Get()->debug(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template <typename... Args>
|
|
void Warn(spdlog::format_string_t<Args...> fmt, Args&&... args)
|
|
{
|
|
Get()->warn(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template <typename... Args>
|
|
void Error(spdlog::format_string_t<Args...> fmt, Args&&... args)
|
|
{
|
|
Get()->error(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
template <typename... Args>
|
|
void Fatal(spdlog::format_string_t<Args...> fmt, Args&&... args)
|
|
{
|
|
Get()->critical(fmt, std::forward<Args>(args)...);
|
|
}
|
|
|
|
} // namespace NLog
|
|
|
|
#endif // AXIO_LOG_H
|
|
|