Class BepInExLogInterpolatedStringHandler
Interpolated string handler for BepInEx Logger. This allows to conditionally skip logging certain messages and speed up logging in certain places.
Syntax
public class BepInExLogInterpolatedStringHandler
Remarks
The class isn't meant to be constructed manually. Instead, use Log(LogLevel, BepInExLogInterpolatedStringHandler) with string interpolation.
Constructors
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
Whether the interpolation is enabled and string will be logged.
Declaration
public bool Enabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
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. |
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. |
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. |
Appends a literal string to the interpolation.
Declaration
public void AppendLiteral(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String |
s |
String to append. |
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |