DiskLogListener Class
Definition
Section titled “Definition”Logs entries using Unity specific outputs.
public class DiskLogListener : ILogListener, IDisposable
Inheritance object
Implements ILogListener, IDisposable
Constructors
Section titled “Constructors”DiskLogListener(string, LogLevel, bool, bool, int)
Section titled “DiskLogListener(string, LogLevel, bool, bool, int)”Creates a new disk log listener.
public DiskLogListener(string localPath, LogLevel displayedLogLevel = LogLevel.Info, bool appendLog = false, bool delayedFlushing = true, int fileLimit = 5)
Parameters
Section titled “Parameters”localPath
string
Path to the log.
displayedLogLevel
LogLevel
Log levels to display.
appendLog
bool
Whether to append logs to an already existing log file.
delayedFlushing
bool
Whether to delay flushing to disk to improve performance. Useful to set this to false
when debugging crashes.
fileLimit
int
Maximum amount of concurrently opened log files. Can help with infinite game boot loops.
Fields
Section titled “Fields”BlacklistedSources
Section titled “BlacklistedSources”public static HashSet<string> BlacklistedSources
Properties
Section titled “Properties”DisplayedLogLevel
Section titled “DisplayedLogLevel”Log levels to display.
public LogLevel DisplayedLogLevel { get; }
LogWriter
Section titled “LogWriter”Writer for the disk log.
public TextWriter LogWriter { get; protected set; }
LogLevelFilter
Section titled “LogLevelFilter”What log levels the listener preliminarily wants.
public LogLevel LogLevelFilter { get; }
Remarks
Section titled “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 BepInEx.Logging.ILogListener.LogEvent(System.Object%2cBepInEx.Logging.LogEventArgs)
whether the messages are going to be processed or discarded.
Methods
Section titled “Methods”LogEvent(object, LogEventArgs)
Section titled “LogEvent(object, LogEventArgs)”Handle an incoming log event.
public void LogEvent(object sender, LogEventArgs eventArgs)
Parameters
Section titled “Parameters”sender
object
Log source that sent the event. Don’t use; instead use
eventArgs
LogEventArgs
Information about the log message.
Dispose()
Section titled “Dispose()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~DiskLogListener()
Section titled “~DiskLogListener()”protected ~DiskLogListener()