Class ManualLogSource
A generic, multi-purpose log source. Exposes simple API to manually emit logs.
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 an interpolated string with the specified log level.
Declaration
public void Log(LogLevel level, BepInExLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
LogLevel |
level |
Log levels to attach to the message. Multiple can be used with bitwise ORing. |
BepInExLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
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 an interpolated string with Debug level.
Declaration
public void LogDebug(BepInExDebugLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExDebugLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
Logs a message with Debug level.
Declaration
public void LogDebug(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs an interpolated string with Error level.
Declaration
public void LogError(BepInExErrorLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExErrorLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
Logs a message with Error level.
Declaration
public void LogError(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs an interpolated string with Fatal level.
Declaration
public void LogFatal(BepInExFatalLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExFatalLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
Logs a message with Fatal level.
Declaration
public void LogFatal(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs an interpolated string with Info level.
Declaration
public void LogInfo(BepInExInfoLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExInfoLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
Logs a message with Info level.
Declaration
public void LogInfo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs an interpolated string with Message level.
Declaration
public void LogMessage(BepInExMessageLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExMessageLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
Logs a message with Message level.
Declaration
public void LogMessage(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object |
data |
Data to log. |
Logs an interpolated string with Warning level.
Declaration
public void LogWarning(BepInExWarningLogInterpolatedStringHandler logHandler)
Parameters
Type | Name | Description |
---|---|---|
BepInExWarningLogInterpolatedStringHandler |
logHandler |
Handler for the interpolated string. |
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> |