diff --git a/Include/Aurora/Debug/SysPanic.hpp b/Include/Aurora/Debug/SysPanic.hpp index a3b6c3d1..8036308a 100644 --- a/Include/Aurora/Debug/SysPanic.hpp +++ b/Include/Aurora/Debug/SysPanic.hpp @@ -19,11 +19,11 @@ static inline void AU_NORETURN SysPanic(fmt::format_string msg, T&& ... ar if (Aurora::RuntimeHasStarted()) { Aurora::Debug::AddMemoryCrunch(); - try + AUROXTL_COMMODITY_TRY { Aurora::Logging::WriteLinef(static_cast(Aurora::Logging::ELogLevel::eError), Aurora::Console::EAnsiColor::eBoldRed, "Fatal", msg, AuForward(args)...); } - catch (...) + AUROXTL_COMMODITY_CATCH { } @@ -38,11 +38,11 @@ static inline void AU_NORETURN SysPanic2(AuUInt uLineHintInNonshipBinary, if (Aurora::RuntimeHasStarted()) { Aurora::Debug::AddMemoryCrunch(); - try + AUROXTL_COMMODITY_TRY { Aurora::Logging::WriteLinef(static_cast(Aurora::Logging::ELogLevel::eError), Aurora::Console::EAnsiColor::eBoldRed, "Fatal", msg, AuForward(args)...); } - catch (...) + AUROXTL_COMMODITY_CATCH { } @@ -50,28 +50,32 @@ static inline void AU_NORETURN SysPanic2(AuUInt uLineHintInNonshipBinary, Aurora::Debug::Panic2(uLineHintInNonshipBinary); } -template -static inline void AU_NORETURN SysPanic() -{ - Aurora::Debug::Panic(); -} - -template -static inline void AU_NORETURN SysPanic2(AuUInt uLineHintInNonshipBinary) -{ - Aurora::Debug::Panic2(uLineHintInNonshipBinary); -} - static inline AU_NORETURN void SysPanic(const char *pMsg) { SysPanic("{}", pMsg); } +#endif + +#if defined(_AUHAS_FMT) +template +#endif +static inline void AU_NORETURN SysPanic() +{ + Aurora::Debug::Panic(); +} + +#if defined(_AUHAS_FMT) +template +#endif +static inline void AU_NORETURN SysPanic2(AuUInt uLineHintInNonshipBinary) +{ + Aurora::Debug::Panic2(uLineHintInNonshipBinary); +} + static inline AU_NORETURN void SysUnreachable_(int uLineHintInNonshipBinary) { Aurora::Debug::Panic2(uLineHintInNonshipBinary); } -#define SysUnreachable() SysUnreachable_(SysSafeLine) - -#endif \ No newline at end of file +#define SysUnreachable() SysUnreachable_(SysSafeLine) \ No newline at end of file diff --git a/Include/Aurora/Logging/Logging.hpp b/Include/Aurora/Logging/Logging.hpp index 3bade1fc..7f2531ae 100644 --- a/Include/Aurora/Logging/Logging.hpp +++ b/Include/Aurora/Logging/Logging.hpp @@ -182,6 +182,8 @@ namespace Aurora::Logging #endif } +#if defined(_AUHAS_FMT) + #define ADD_AU_GLOBAL_ALIAS(level)\ template \ static void AuLog ## level(fmt::format_string line, T&& ... args) \ @@ -189,6 +191,17 @@ namespace Aurora::Logging Aurora::Logging::Log ## level(line, AuForward(args)...); \ } +#else + +#define ADD_AU_GLOBAL_ALIAS(level)\ + template \ + static void AuLog ## level(const AuString &line, T&& ... args) \ + { \ + Aurora::Logging::Log ## level(line); \ + } + +#endif + ADD_AU_GLOBAL_ALIAS(Info) ADD_AU_GLOBAL_ALIAS(Dbg) ADD_AU_GLOBAL_ALIAS(Warn)