Advanced Runtime Logging UE5 plugin — Solution for Real-Time Logs in Editor or Shipping Builds

GLS is designed with performance in mind. If GLS is disabled for a specific build (e.g., via Project Settings → Plugins → Game Logs System), all GLS subsystems remain inactive, ensuring that no GLS-specific logic or processing runs. This prevents any overhead in builds where GLS is not needed.

Additionally, the GLS_LOG macro is designed to seamlessly redirect logs to the default UE_LOG system if GLS subsystems are inactive. This ensures that log functionality remains intact while avoiding unnecessary processing by GLS.

Here’s how this is achieved:

  1. Subsystem Activation Check:
    GLS subsystems are initialized only if GLS is enabled. If GLS is disabled, none of its subsystems (e.g., UGLSSubsystem) are activated, effectively bypassing all GLS-related code.
bool UGLSSubsystem::ShouldCreateSubsystem(UObject* Outer) const
{
    return FGLSUtils::IsGLSEnabled();
}
  1. Macro Redirection:
    The GLS_LOG macro checks subsystem status. If GLS is inactive, it directly redirects logs to UE_LOG, ensuring minimal overhead.
#define GLS_LOG(CategoryName, Verbosity, Format, ...) \
if (FGLSUtils::IsGLSEnabled()) \
{ \
        GLSSubsystem->Log(CategoryName, Verbosity, Format, ##__VA_ARGS__); \
} 
else \
{ \
        UE_LOG(CategoryName, Verbosity, Format, ##__VA_ARGS__); \
}

Thanks for the great question!

3 Likes