Class TraceLogSource

A source that routes all logs from the inbuilt .NET System.Diagnostics.Trace API to the BepInEx logging system.

Inheritance
System.Object System.MarshalByRefObject System.Diagnostics.TraceListener TraceLogSource
Implements
System.IDisposable
Inherited Members
System.Diagnostics.TraceListener.Dispose() System.Diagnostics.TraceListener.Dispose(System.Boolean) System.Diagnostics.TraceListener.Close() System.Diagnostics.TraceListener.Flush() System.Diagnostics.TraceListener.Fail(System.String) System.Diagnostics.TraceListener.Fail(System.String, System.String) System.Diagnostics.TraceListener.GetSupportedAttributes() System.Diagnostics.TraceListener.Write(System.Object) System.Diagnostics.TraceListener.Write(System.String, System.String) System.Diagnostics.TraceListener.Write(System.Object, System.String) System.Diagnostics.TraceListener.WriteIndent() System.Diagnostics.TraceListener.WriteLine(System.Object) System.Diagnostics.TraceListener.WriteLine(System.String, System.String) System.Diagnostics.TraceListener.WriteLine(System.Object, System.String) System.Diagnostics.TraceListener.TraceData(System.Diagnostics.TraceEventCache, System.String, System.Diagnostics.TraceEventType, System.Int32, System.Object) System.Diagnostics.TraceListener.TraceData(System.Diagnostics.TraceEventCache, System.String, System.Diagnostics.TraceEventType, System.Int32, System.Object[]) System.Diagnostics.TraceListener.TraceEvent(System.Diagnostics.TraceEventCache, System.String, System.Diagnostics.TraceEventType, System.Int32) System.Diagnostics.TraceListener.TraceTransfer(System.Diagnostics.TraceEventCache, System.String, System.Int32, System.String, System.Guid) System.Diagnostics.TraceListener.Attributes System.Diagnostics.TraceListener.Name System.Diagnostics.TraceListener.IsThreadSafe System.Diagnostics.TraceListener.IndentLevel System.Diagnostics.TraceListener.IndentSize System.Diagnostics.TraceListener.Filter System.Diagnostics.TraceListener.NeedIndent System.Diagnostics.TraceListener.TraceOutputOptions System.MarshalByRefObject.MemberwiseClone(System.Boolean) System.MarshalByRefObject.GetLifetimeService() System.MarshalByRefObject.InitializeLifetimeService() System.MarshalByRefObject.CreateObjRef(System.Type) 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.Core.dll
Syntax
public class TraceLogSource : TraceListener, IDisposable

Constructors

TraceLogSource()

Creates a new trace log source.

Declaration
protected TraceLogSource()

Properties

IsListening

Whether Trace logs are currently being rerouted.

Declaration
public static bool IsListening { get; }
Property Value
Type Description
System.Boolean

LogSource

Internal log source.

Declaration
protected ManualLogSource LogSource { get; }
Property Value
Type Description
ManualLogSource

Methods

CreateSource()

Creates a new trace log source.

Declaration
public static ILogSource CreateSource()
Returns
Type Description
ILogSource

New log source (or already existing one).

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Declaration
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
Parameters
Type Name Description
System.Diagnostics.TraceEventCache eventCache
System.String source
System.Diagnostics.TraceEventType eventType
System.Int32 id
System.String message
Overrides
System.Diagnostics.TraceListener.TraceEvent(System.Diagnostics.TraceEventCache, System.String, System.Diagnostics.TraceEventType, System.Int32, System.String)

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])

Declaration
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
Parameters
Type Name Description
System.Diagnostics.TraceEventCache eventCache
System.String source
System.Diagnostics.TraceEventType eventType
System.Int32 id
System.String format
System.Object[] args
Overrides
System.Diagnostics.TraceListener.TraceEvent(System.Diagnostics.TraceEventCache, System.String, System.Diagnostics.TraceEventType, System.Int32, System.String, System.Object[])

Write(String)

Writes a message to the underlying ManualLogSource instance.

Declaration
public override void Write(string message)
Parameters
Type Name Description
System.String message

The message to write.

Overrides
System.Diagnostics.TraceListener.Write(System.String)

WriteLine(String)

Writes a message and a newline to the underlying ManualLogSource instance.

Declaration
public override void WriteLine(string message)
Parameters
Type Name Description
System.String message

The message to write.

Overrides
System.Diagnostics.TraceListener.WriteLine(System.String)

Implements

System.IDisposable