Class MethodUtil
- Namespace
- RisingV.Shared.Diagnostics
- Assembly
- RisingV.Shared.dll
public static class MethodUtil
- Inheritance
-
MethodUtil
- Inherited Members
Methods
GetCaller(int, string, bool, Func<StackTrace, int, StackFrame?>?)
Gets the name of the calling method, optionally including the line number.
public static string GetCaller(int skipFrames = 1, string format = "{methodName}(:{lineNumber})", bool includeLineNumber = true, Func<StackTrace, int, StackFrame?>? frameFinder = null)
Parameters
skipFrames
intNumber of frames to skip in the stack trace. Default is 1, which skips the current method.
format
stringFormat string for the output. Default is "{methodName}(:{lineNumber})".
includeLineNumber
boolIf true, includes the line number in the output. Default is true.
frameFinder
Func<StackTrace, int, StackFrame>Function to find a specific stack frame. If null, the default frame finder is used.
Returns
- string
String representing the calling method's name and optionally its line number.