Class DiskLogListener

Logs entries using Unity specific outputs.

Inheritance
System.Object DiskLogListener
Implements
ILogListener System.IDisposable
Inherited Members
System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace: BepInEx.Logging
Assembly: BepInEx.dll
Syntax
public class DiskLogListener : ILogListener, IDisposable

Constructors

DiskLogListener(String, LogLevel, Boolean, Boolean)

Creates a new disk log listener.

Declaration
public DiskLogListener(string localPath, LogLevel displayedLogLevel = LogLevel.Info, bool appendLog = false, bool includeUnityLog = false)
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 includeUnityLog

Whether to include Unity log into the disk log.

Properties

DisplayedLogLevel

Log levels to display.

Declaration
public LogLevel DisplayedLogLevel { get; set; }
Property Value
Type Description
LogLevel

FlushTimer

Timer for flushing the logs to a file.

Declaration
public Timer FlushTimer { get; protected set; }
Property Value
Type Description
System.Threading.Timer

LogWriter

Writer for the disk log.

Declaration
public TextWriter LogWriter { get; protected set; }
Property Value
Type Description
System.IO.TextWriter

WriteFromUnityLog

Whether to write Unity log messages to disk log.

Declaration
public bool WriteFromUnityLog { get; set; }
Property Value
Type Description
System.Boolean

Methods

Dispose()

Declaration
public void Dispose()

Finalize()

Disposes of Disk logger

Declaration
protected void Finalize()

LogEvent(Object, LogEventArgs)

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.

Implements

ILogListener
System.IDisposable