TraceLogSource Class
Definition
Section titled “Definition”A source that routes all logs from the inbuilt .NET Trace API to the BepInEx logging system.
public class TraceLogSource : TraceListener, IDisposable
Inheritance object → MarshalByRefObject → TraceListener
Implements IDisposable
Constructors
Section titled “Constructors”TraceLogSource()
Section titled “TraceLogSource()”Creates a new trace log source.
protected TraceLogSource()
Properties
Section titled “Properties”IsListening
Section titled “IsListening”Whether Trace logs are currently being rerouted.
public static bool IsListening { get; }
LogSource
Section titled “LogSource”Internal log source.
protected ManualLogSource LogSource { get; }
Methods
Section titled “Methods”CreateSource()
Section titled “CreateSource()”Creates a new trace log source.
public static ILogSource CreateSource()
Returns
Section titled “Returns”ILogSource
New log source (or already existing one).
Write(string)
Section titled “Write(string)”Writes a message to the underlying ManualLogSource instance.
public override void Write(string message)
Parameters
Section titled “Parameters”message
string
The message to write.
WriteLine(string)
Section titled “WriteLine(string)”Writes a message and a newline to the underlying ManualLogSource instance.
public override void WriteLine(string message)
Parameters
Section titled “Parameters”message
string
The message to write.
TraceEvent(TraceEventCache, string, TraceEventType, int, string, params object[])
Section titled “TraceEvent(TraceEventCache, string, TraceEventType, int, string, params object[])”Writes trace information, a formatted array of objects and event information to the listener specific output.
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
Parameters
Section titled “Parameters”eventCache
TraceEventCache
A
source
string
A name used to identify the output, typically the name of the application that generated the trace event.
eventType
TraceEventType
One of the
id
int
A numeric identifier for the event.
format
string
A format string that contains zero or more format items, which correspond to objects in the args
array.
args
object[]
An object array containing zero or more objects to format.
TraceEvent(TraceEventCache, string, TraceEventType, int, string)
Section titled “TraceEvent(TraceEventCache, string, TraceEventType, int, string)”Writes trace information, a message, and event information to the listener specific output.
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
Parameters
Section titled “Parameters”eventCache
TraceEventCache
A
source
string
A name used to identify the output, typically the name of the application that generated the trace event.
eventType
TraceEventType
One of the
id
int
A numeric identifier for the event.
message
string
A message to write.