Class TraceLogSource
A source that routes all logs from the inbuilt .NET System.Diagnostics.Trace API to the BepInEx logging system.
Namespace: BepInEx.Logging
Assembly: BepInEx.Core.dll
Syntax
public class TraceLogSource : TraceListener, IDisposable
Constructors
Creates a new trace log source.
Declaration
protected TraceLogSource()
Properties
Whether Trace logs are currently being rerouted.
Declaration
public static bool IsListening { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Internal log source.
Declaration
protected ManualLogSource LogSource { get; }
Property Value
Type | Description |
---|---|
ManualLogSource |
Methods
Creates a new trace log source.
Declaration
public static ILogSource CreateSource()
Returns
Type | Description |
---|---|
ILogSource |
New log source (or already existing one). |
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)
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[])
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)
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