Class UnityLogger
- Namespace
- Switchboard
- Assembly
- Switchboard.UnityLogger.dll
An implementation of ILogger that targets the UnityLogHandler.
public sealed class UnityLogger : ILogger
- Inheritance
-
UnityLogger
- Implements
- Extension Methods
Properties
Default
Gets a static instance of the class.
public static UnityLogger Default { get; }
LogCallerInfo
Gets or sets whether information about the caller of the log method should be displayed.
public bool LogCallerInfo { get; set; }
LogLevel
Gets or sets the minimum level of significance required for a log entry to be processed.
public LogLevel LogLevel { get; set; }
Methods
Log(LogLevel, Exception, ReadOnlySpan<char>)
Logs an exception.
public void Log(LogLevel logLevel, Exception exception, ReadOnlySpan<char> message)
Parameters
logLevelLogLevelThe level of significance assigned to the exception.
exceptionExceptionThe exception to log.
messageReadOnlySpan<char>A log message to be included with the exception.
Exceptions
- ArgumentNullException
Thrown if
exceptionis null.
Log(LogLevel, ReadOnlySpan<char>, string, string, int)
Logs a message.
public void Log(LogLevel logLevel, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logLevelLogLevelThe level of significance assigned to the message.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
lineNumberintThe line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.