๐ชต Logging Helper Macros
Short Description
Preprocessor macros that provide a compact API for logging messages with different importance levels, formatted output and optional on-screen toasts.
Long Description
The logging macros wrap the internal GorgeousLogging::LogMessage_Internal implementation and provide sensible defaults for duration, routing and override behaviour. They exist to make emitting information, success, warning, error and fatal messages concise and uniform across the codebase.
๐ง Default configuration macros
GT_DURATIONโ default on-screen duration (float).GT_PRINT_TO_SCREENโ whether to print to screen by default.GT_PRINT_TO_SCREEN_ON_INFOโ whether info messages appear on-screen by default.GT_PRINT_TO_LOGโ whether to print to log by default.GT_OVERRIDE_LOGGING_IF_PRESENTโ override existing messages with the same key by default.GT_SHOW_AS_TOASTโ whether to show as editor toast by default.
๐ Primary macros
GT_LOG_MESSAGE_FULL_EX(Importance, Message, LoggingKey, Duration, bPrintToScreen, bPrintToLog, bOverrideLoggingIfPresent, bShowAsToast, WorldContextObject, HyperlinkPtr)
Low-level macro that forwards a prepared message to the internal logger with fully specified parameters.
GT_LOG_MESSAGE_FULL_EX(Logging_Information, TEXT("Hello"), TEXT("MyKey"), 4.f, true, true, true, false, nullptr, nullptr);
GT_LOG_FORMAT_FULL_EX(...) and convenience macros
GT_LOG_FORMAT_FULL_EX formats a printf-style string and forwards to GT_LOG_MESSAGE_FULL_EX. The library then exposes convenience macros for each importance level:
GT_I_LOG/GT_I_LOG_FULL/GT_I_LOG_FULL_EXโ informationGT_S_LOG/GT_S_LOG_FULL/GT_S_LOG_FULL_EXโ successGT_W_LOG/GT_W_LOG_FULL/GT_W_LOG_FULL_EXโ warningGT_E_LOG/GT_E_LOG_FULL/GT_E_LOG_FULL_EXโ error (plus ensure/verify variants)GT_F_LOG/GT_F_LOG_FULL/GT_F_LOG_FULL_EXโ fatal (plus checkf variant)
GT_I_LOG(TEXT("Init"), TEXT("Initialization completed: %s"), *Name);
Error & fatal helpers
The error and fatal macros include variants that wrap ensure, verify and checkf to assert conditions while also emitting an informative log message.
GT_E_LOG_ENSURE(Ptr != nullptr, TEXT("NullPtr"), TEXT("Pointer must not be null"));
Notes
- Each convenience macro becomes a no-op when the corresponding importance level is disabled via
GT_*_LOG_ENABLEDflags. - Prefer the simple
GT_I_LOG/GT_W_LOGfamily for most use-cases and only use the_FULL_EXforms when custom routing or hyperlink metadata is required.
Where to find the macros
src/content/gorgeous-core/RuntimeUtilities/Helpers/Headers/Macros/GorgeousLoggingHelperMacros.h