Class DiskLogListener
Logs entries using Unity specific outputs.
Syntax
public class DiskLogListener : ILogListener, IDisposable
Constructors
Creates a new disk log listener.
Declaration
public DiskLogListener(string localPath, LogLevel displayedLogLevel = LogLevel.Info, bool appendLog = false, bool delayedFlushing = true, int fileLimit = 5)
Parameters
Type | Name | Description |
---|---|---|
System.String |
localPath |
Path to the log. |
LogLevel |
displayedLogLevel |
Log levels to display. |
System.Boolean |
appendLog |
Whether to append logs to an already existing log file. |
System.Boolean |
delayedFlushing |
Whether to delay flushing to disk to improve performance. Useful to set this to false when debugging crashes. |
System.Int32 |
fileLimit |
Maximum amount of concurrently opened log files. Can help with infinite game boot loops. |
Fields
BlacklistedSources
Declaration
public static HashSet<string> BlacklistedSources
Field Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.String> |
Properties
Log levels to display.
Declaration
public LogLevel DisplayedLogLevel { get; }
Property Value
Type | Description |
---|---|
LogLevel |
What log levels the listener preliminarily wants.
Declaration
public LogLevel LogLevelFilter { get; }
Property Value
Type | Description |
---|---|
LogLevel |
Remarks
The filter is used to more efficiently discard log messages that aren't being listened to. As such, the filter should represent the log levels that the listener will always want to process. It is up to the the implementation of LogEvent(Object, LogEventArgs) whether the messages are going to be processed or discarded.
Writer for the disk log.
Declaration
public TextWriter LogWriter { get; protected set; }
Property Value
Type | Description |
---|---|
System.IO.TextWriter |
Methods
Declaration
public void Dispose()
Declaration
protected void Finalize()
Handle an incoming log event.
Declaration
public void LogEvent(object sender, LogEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
sender |
Log source that sent the event. Don't use; instead use Source |
LogEventArgs |
eventArgs |
Information about the log message. |