AuroraRuntime/Include/Aurora/Console/Logging/Logging.hpp

71 lines
2.1 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Logging.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
namespace Aurora::Console::Logging
{
#if defined(_AUHAS_FMT)
template<typename ... T>
static inline void WriteLinef(const AuString &tag, const AuString &msg, T&& ... args)
{
WriteLine(ConsoleMessage(EAnsiColor::eReset, tag, fmt::format(msg, std::forward<T>(args)...)));
}
template<typename ... T>
static inline void WriteLinef(EAnsiColor color, const AuString &tag, const AuString &msg, T&& ... args)
{
WriteLine(ConsoleMessage(color, tag, fmt::format(msg, std::forward<T>(args)...)));
}
template<typename ... T>
static inline void LogVerbose(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eYellow, "Verbose", line, std::forward<T>(args)...);
}
#if defined(STAGING) || defined(DEBUG)
template<typename ... T>
static inline void LogVerboseNoShip(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eYellow, "Verbose", line, std::forward<T>(args)...);
}
#else
#define LogVerboseNoShip(...)
#endif
template<typename ... T>
static inline void LogInfo(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eGreen, "Info", line, std::forward<T>(args)...);
}
template<typename ... T>
static inline void LogDbg(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eYellow, "Debug", line, std::forward<T>(args)...);
}
template<typename ... T>
static inline void LogWarn(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eRed, "Warn", line, std::forward<T>(args)...);
}
template<typename ... T>
static inline void LogError(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eBoldRed, "Error", line, std::forward<T>(args)...);
}
template<typename ... T>
static inline void LogGame(const AuString &line, T&& ... args)
{
WriteLinef(EAnsiColor::eBlue, "Game", line, std::forward<T>(args)...);
}
#endif
}