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.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, 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(Object)

Logs a message with Debug level.

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

Data to log.

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(Object)

Logs a message with Fatal level.

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

Data to log.

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(Object)

Logs a message with Message level.

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

Data to log.

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