Class ManualLogSource
A generic, multi-purpose log source. Exposes simple API to manually emit logs.
Namespace: BepInEx.Logging
Assembly: BepInEx.dll
Syntax
public class ManualLogSource : ILogSource, IDisposable
Constructors
Creates a manual log source.
Declaration
public ManualLogSource(string sourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String |
sourceName |
Name of the log source. |
Properties
Name of the log source.
Declaration
public string SourceName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Declaration
public void Dispose()
Logs a message with the specified log level.
Declaration
public void Log(LogLevel level, object data)
Parameters
Type | Name | Description |
---|---|---|
LogLevel |
level |
Log levels to attach to the message. Multiple can be used with bitwise ORing. |
System.Object |
data |
Data to log. |
Logs a message with Debug level.
Declaration
public void LogDebug(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs a message with Error level.
Declaration
public void LogError(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs a message with Fatal level.
Declaration
public void LogFatal(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs a message with Info level.
Declaration
public void LogInfo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs a message with Message level.
Declaration
public void LogMessage(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs a message with Warning level.
Declaration
public void LogWarning(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Events
LogEvent
Event that sends the log message. Call System.EventHandler.Invoke(System.Object,System.EventArgs) to send a log message.
Declaration
public event EventHandler<LogEventArgs> LogEvent
Event Type
Type | Description |
---|---|
System.EventHandler<LogEventArgs> |
Implements
System.IDisposable