Skip to content

ManualLogSource Class

A generic, multi-purpose log source. Exposes simple API to manually emit logs.

C#
public class ManualLogSource : ILogSource, IDisposable

Inheritance object

Implements ILogSource, IDisposable

Creates a manual log source.

C#
public ManualLogSource(string sourceName)

sourceName string
Name of the log source.

Name of the log source.

C#
public string SourceName { get; }

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

C#
public void Dispose()

Logs a message with the specified log level.

C#
public void Log(LogLevel level, object data)

level LogLevel
Log levels to attach to the message. Multiple can be used with bitwise ORing.

data object
Data to log.

Log(LogLevel, BepInExLogInterpolatedStringHandler)

Section titled “Log(LogLevel, BepInExLogInterpolatedStringHandler)”

Logs an interpolated string with the specified log level.

C#
public void Log(LogLevel level, BepInExLogInterpolatedStringHandler logHandler)

level LogLevel
Log levels to attach to the message. Multiple can be used with bitwise ORing.

logHandler BepInExLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Fatal level.

C#
public void LogFatal(object data)

data object
Data to log.

LogFatal(BepInExFatalLogInterpolatedStringHandler)

Section titled “LogFatal(BepInExFatalLogInterpolatedStringHandler)”

Logs an interpolated string with Fatal level.

C#
public void LogFatal(BepInExFatalLogInterpolatedStringHandler logHandler)

logHandler BepInExFatalLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Error level.

C#
public void LogError(object data)

data object
Data to log.

LogError(BepInExErrorLogInterpolatedStringHandler)

Section titled “LogError(BepInExErrorLogInterpolatedStringHandler)”

Logs an interpolated string with Error level.

C#
public void LogError(BepInExErrorLogInterpolatedStringHandler logHandler)

logHandler BepInExErrorLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Warning level.

C#
public void LogWarning(object data)

data object
Data to log.

LogWarning(BepInExWarningLogInterpolatedStringHandler)

Section titled “LogWarning(BepInExWarningLogInterpolatedStringHandler)”

Logs an interpolated string with Warning level.

C#
public void LogWarning(BepInExWarningLogInterpolatedStringHandler logHandler)

logHandler BepInExWarningLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Message level.

C#
public void LogMessage(object data)

data object
Data to log.

LogMessage(BepInExMessageLogInterpolatedStringHandler)

Section titled “LogMessage(BepInExMessageLogInterpolatedStringHandler)”

Logs an interpolated string with Message level.

C#
public void LogMessage(BepInExMessageLogInterpolatedStringHandler logHandler)

logHandler BepInExMessageLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Info level.

C#
public void LogInfo(object data)

data object
Data to log.

LogInfo(BepInExInfoLogInterpolatedStringHandler)

Section titled “LogInfo(BepInExInfoLogInterpolatedStringHandler)”

Logs an interpolated string with Info level.

C#
public void LogInfo(BepInExInfoLogInterpolatedStringHandler logHandler)

logHandler BepInExInfoLogInterpolatedStringHandler
Handler for the interpolated string.

Logs a message with Debug level.

C#
public void LogDebug(object data)

data object
Data to log.

LogDebug(BepInExDebugLogInterpolatedStringHandler)

Section titled “LogDebug(BepInExDebugLogInterpolatedStringHandler)”

Logs an interpolated string with Debug level.

C#
public void LogDebug(BepInExDebugLogInterpolatedStringHandler logHandler)

logHandler BepInExDebugLogInterpolatedStringHandler
Handler for the interpolated string.

Event that sends the log message. Call System.EventHandler.Invoke(System.Object%2cSystem.EventArgs) to send a log message.

C#
public event EventHandler<LogEventArgs> LogEvent

EventHandler<LogEventArgs>