Class BepInExLogInterpolatedStringHandler

Interpolated string handler for BepInEx Logger. This allows to conditionally skip logging certain messages and speed up logging in certain places.

Inheritance
System.Object BepInExLogInterpolatedStringHandler BepInExDebugLogInterpolatedStringHandler BepInExErrorLogInterpolatedStringHandler BepInExFatalLogInterpolatedStringHandler BepInExInfoLogInterpolatedStringHandler BepInExMessageLogInterpolatedStringHandler BepInExWarningLogInterpolatedStringHandler
Inherited Members
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.Core.Logging.Interpolation
Assembly: BepInEx.Core.dll
Syntax
public class BepInExLogInterpolatedStringHandler
Remarks

The class isn't meant to be constructed manually. Instead, use Log(LogLevel, BepInExLogInterpolatedStringHandler) with string interpolation.

Constructors

BepInExLogInterpolatedStringHandler(Int32, Int32, LogLevel, out Boolean)

Constructs a log handler.

Declaration
public BepInExLogInterpolatedStringHandler(int literalLength, int formattedCount, LogLevel logLevel, out bool isEnabled)
Parameters
Type Name Description
System.Int32 literalLength

Length of the literal string.

System.Int32 formattedCount

Number for formatted items.

LogLevel logLevel

Log level the message belongs to.

System.Boolean isEnabled

Whether this string should be logged.

Properties

Enabled

Whether the interpolation is enabled and string will be logged.

Declaration
public bool Enabled { get; }
Property Value
Type Description
System.Boolean

Methods

AppendFormatted(IntPtr, String)

Append an IntPtr.

Declaration
public void AppendFormatted(IntPtr t, string format)
Parameters
Type Name Description
System.IntPtr t

Item to append.

System.String format

Format to append with.

AppendFormatted<T>(T)

Appends a value to the interpolation.

Declaration
public void AppendFormatted<T>(T t)
Parameters
Type Name Description
T t

Value to append.

Type Parameters
Name Description
T

Type of the value to append.

AppendFormatted<T>(T, String)

Append a formattable item.

Declaration
public void AppendFormatted<T>(T t, string format)
    where T : IFormattable
Parameters
Type Name Description
T t

Item to append.

System.String format

Format to append with.

Type Parameters
Name Description
T

Item type.

AppendLiteral(String)

Appends a literal string to the interpolation.

Declaration
public void AppendLiteral(string s)
Parameters
Type Name Description
System.String s

String to append.

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()