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
loggerILoggerThe logger to be used instead of the Unity logger.
Exceptions
- ArgumentNullException
Thrown if
loggeris null.
Methods
LogException(Exception, Object)
Logs an exception message.
public void LogException(Exception exception, Object context)
Parameters
exceptionExceptionRuntime Exception.
contextObjectThe 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)