BepInExLogInterpolatedStringHandler Class
Definition
Section titled “Definition”Interpolated string handler for BepInEx Logger. This allows to conditionally skip logging certain messages and speed up logging in certain places.
public class BepInExLogInterpolatedStringHandlerInheritance object
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”BepInExLogInterpolatedStringHandler(int, int, LogLevel, out bool)
Section titled “BepInExLogInterpolatedStringHandler(int, int, LogLevel, out bool)”Constructs a log handler.
public BepInExLogInterpolatedStringHandler(int literalLength, int formattedCount, LogLevel logLevel, out bool isEnabled)Parameters
Section titled “Parameters”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.
Properties
Section titled “Properties”Enabled
Section titled “Enabled”Whether the interpolation is enabled and string will be logged.
public bool Enabled { get; }Methods
Section titled “Methods”AppendLiteral(string)
Section titled “AppendLiteral(string)”Appends a literal string to the interpolation.
public void AppendLiteral(string s)Parameters
Section titled “Parameters”s string
String to append.
AppendFormatted(T)
Section titled “AppendFormatted(T)”Appends a value to the interpolation.
public void AppendFormatted<T>(T t)Parameters
Section titled “Parameters”t T
Value to append.
AppendFormatted(T, string)
Section titled “AppendFormatted(T, string)”Append a formattable item.
public void AppendFormatted<T>(T t, string format) where T : IFormattableParameters
Section titled “Parameters”t T
Item to append.
format string
Format to append with.
AppendFormatted(nint, string)
Section titled “AppendFormatted(nint, string)”Append an IntPtr.
public void AppendFormatted(nint t, string format)Parameters
Section titled “Parameters”t nint
Item to append.
format string
Format to append with.
ToString()
Section titled “ToString()”Returns a string that represents the current object.
public override string ToString()Returns
Section titled “Returns”string
A string that represents the current object.