Class UnityLoggerBridge
Bridges Unity's logging system with the FishMMO.Logging system by implementing ILogHandler. Intercepts all Unity Debug.Log messages and forwards them to the central Log manager, while also preventing Unity's default console output. Designed to be separate from core ILogger implementations.
public class UnityLoggerBridge : ILogHandler
- Inheritance
-
UnityLoggerBridge
- Implements
-
ILogHandler
- Inherited Members
Methods
Initialize(Action<string>)
Initializes the Unity logger bridge and sets it as Unity's primary log handler. Should be called once, typically at application start.
public static void Initialize(Action<string> internalLogMessageCallback)
Parameters
LogException(Exception, Object)
Implementation of ILogHandler.LogException. Intercepts all Debug.LogException messages.
public void LogException(Exception exception, Object context)
Parameters
exceptionExceptionThe exception to log.
contextObjectThe Unity object context.
LogFormat(LogType, Object, string, params object[])
Implementation of ILogHandler.LogFormat. Intercepts all Debug.Log, Debug.LogWarning, Debug.LogError messages.
public void LogFormat(LogType logType, Object context, string format, params object[] args)
Parameters
logTypeLogTypeThe type of log message.
contextObjectThe Unity object context.
formatstringThe log message format string.
argsobject[]Arguments for the format string.
Shutdown()
Shuts down the Unity logger bridge and restores Unity's default log handler. Should be called during application shutdown for cleanup.
public static void Shutdown()