Class ManualLogSource

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

Inheritance
System.Object ManualLogSource
Implements
ILogSource System.IDisposable
Inherited Members
System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace: BepInEx.Logging
Assembly: BepInEx.Core.dll
Syntax
public class ManualLogSource : ILogSource, IDisposable

Constructors

ManualLogSource(String)

Creates a manual log source.

Declaration
public ManualLogSource(string sourceName)
Parameters
Type Name Description
System.String sourceName

Name of the log source.

Properties

SourceName

Name of the log source.

Declaration
public string SourceName { get; }
Property Value
Type Description
System.String

Methods

Dispose()

Declaration
public void Dispose()

Log(LogLevel, BepInExLogInterpolatedStringHandler)

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.

Log(LogLevel, Object)

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.

LogDebug(BepInExDebugLogInterpolatedStringHandler)

Logs an interpolated string with Debug level.

Declaration
public void LogDebug(BepInExDebugLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExDebugLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogDebug(Object)

Logs a message with Debug level.

Declaration
public void LogDebug(object data)
Parameters
Type Name Description
System.Object data

Data to log.

LogError(BepInExErrorLogInterpolatedStringHandler)

Logs an interpolated string with Error level.

Declaration
public void LogError(BepInExErrorLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExErrorLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogError(Object)

Logs a message with Error level.

Declaration
public void LogError(object data)
Parameters
Type Name Description
System.Object data

Data to log.

LogFatal(BepInExFatalLogInterpolatedStringHandler)

Logs an interpolated string with Fatal level.

Declaration
public void LogFatal(BepInExFatalLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExFatalLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogFatal(Object)

Logs a message with Fatal level.

Declaration
public void LogFatal(object data)
Parameters
Type Name Description
System.Object data

Data to log.

LogInfo(BepInExInfoLogInterpolatedStringHandler)

Logs an interpolated string with Info level.

Declaration
public void LogInfo(BepInExInfoLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExInfoLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogInfo(Object)

Logs a message with Info level.

Declaration
public void LogInfo(object data)
Parameters
Type Name Description
System.Object data

Data to log.

LogMessage(BepInExMessageLogInterpolatedStringHandler)

Logs an interpolated string with Message level.

Declaration
public void LogMessage(BepInExMessageLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExMessageLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogMessage(Object)

Logs a message with Message level.

Declaration
public void LogMessage(object data)
Parameters
Type Name Description
System.Object data

Data to log.

LogWarning(BepInExWarningLogInterpolatedStringHandler)

Logs an interpolated string with Warning level.

Declaration
public void LogWarning(BepInExWarningLogInterpolatedStringHandler logHandler)
Parameters
Type Name Description
BepInExWarningLogInterpolatedStringHandler logHandler

Handler for the interpolated string.

LogWarning(Object)

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

ILogSource
System.IDisposable