Skip to content

BepInExLogInterpolatedStringHandler Class

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

C#
public class BepInExLogInterpolatedStringHandler

Inheritance object

The class isn’t meant to be constructed manually. Instead, use BepInEx.Logging.ManualLogSource.Log(BepInEx.Logging.LogLevel%2cBepInEx.Core.Logging.Interpolation.BepInExLogInterpolatedStringHandler) with string interpolation.

BepInExLogInterpolatedStringHandler(int, int, LogLevel, out bool)

Section titled “BepInExLogInterpolatedStringHandler(int, int, LogLevel, out bool)”

Constructs a log handler.

C#
public BepInExLogInterpolatedStringHandler(int literalLength, int formattedCount, LogLevel logLevel, out bool isEnabled)

literalLength int
Length of the literal string.

formattedCount int
Number for formatted items.

logLevel LogLevel
Log level the message belongs to.

isEnabled bool
Whether this string should be logged.

Whether the interpolation is enabled and string will be logged.

C#
public bool Enabled { get; }

Appends a literal string to the interpolation.

C#
public void AppendLiteral(string s)

s string
String to append.

Appends a value to the interpolation.

C#
public void AppendFormatted<T>(T t)

t T
Value to append.

Append a formattable item.

C#
public void AppendFormatted<T>(T t, string format) where T : IFormattable

t T
Item to append.

format string
Format to append with.

Append an IntPtr.

C#
public void AppendFormatted(nint t, string format)

t nint
Item to append.

format string
Format to append with.

Returns a string that represents the current object.

C#
public override string ToString()

string
A string that represents the current object.