Table of Contents

Class UnityLoggerBridge

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

internalLogMessageCallback Action<string>

Callback for internal log messages.

LogException(Exception, Object)

Implementation of ILogHandler.LogException. Intercepts all Debug.LogException messages.

public void LogException(Exception exception, Object context)

Parameters

exception Exception

The exception to log.

context Object

The 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

logType LogType

The type of log message.

context Object

The Unity object context.

format string

The log message format string.

args object[]

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()