Table of Contents

Class UnityLogHijacker

Namespace
Switchboard
Assembly
Switchboard.UnityLogger.dll

Redirects calls to Unity log methods to an ILogger implementation instead, when assigned to UnityEngine.Debug.unityLogger.logHandler.

public sealed class UnityLogHijacker : ILogHandler
Inheritance
UnityLogHijacker
Implements
ILogHandler

Constructors

UnityLogHijacker(ILogger)

Initializes a new instance of the class.

public UnityLogHijacker(ILogger logger)

Parameters

logger ILogger

The logger to be used instead of the Unity logger.

Exceptions

ArgumentNullException

Thrown if logger is null.

Methods

LogException(Exception, Object)

Logs an exception message.

public void LogException(Exception exception, Object context)

Parameters

exception Exception

Runtime Exception.

context Object

The UnityEngine.Object to which the exception applies.

LogFormat(LogType, Object, string, params object[])

Logs a formatted message.

public void LogFormat(LogType logType, Object context, string format, params object[] args)

Parameters

logType LogType

The type of log message.

context Object

The UnityEngine.Object to which the message applies.

format string

A composite format string.

args object[]

Format arguments.