๐Ÿชต 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 โ€” information
  • GT_S_LOG / GT_S_LOG_FULL / GT_S_LOG_FULL_EX โ€” success
  • GT_W_LOG / GT_W_LOG_FULL / GT_W_LOG_FULL_EX โ€” warning
  • GT_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_ENABLED flags.
  • Prefer the simple GT_I_LOG / GT_W_LOG family for most use-cases and only use the _FULL_EX forms when custom routing or hyperlink metadata is required.

Where to find the macros

src/content/gorgeous-core/RuntimeUtilities/Helpers/Headers/Macros/GorgeousLoggingHelperMacros.h