current*()

Five system functions are available to provide metadata about the current source location for debugging and logging purposes. Each of these methods is evaluated at compile-time, and will return constant data based on their location in the source code.

currentLineNumber()

Returns the line number as a 1-based index where the function call occurred in the source file.

method currentLineNumber(): Integer;
int currentLineNumber();
func currentLineNumber() -> Int
int currentLineNumber();

currentFileName()

Returns the full path and filename of the source file where the function call occurred.

method currentFileName(): String;
string currentFileName();
func currentFileName() -> String
String currentFileName();

currentMethodName()

Returns the name of the method that contains the function call.

method currentMethodName(): String;
string currentMethodName();
func currentMethodName() -> String
String currentMethodName();

currentPropertyName()

Returns the name of the property of which this method is an accessor.

method currentMethodName(): String;
string currentMethodName();
func currentMethodName() -> String
String currentMethodName();

currentMethodSignature()

Returns the full signature of the method that contains the function call, including full class name, method name and all parameters and their fully qualified type names. This is useful for distinguishing between different overloads of the same method.

method currentMethodSignature(): String;
string currentMethodSignature();
func currentMethodSignature() -> String
String currentMethodSignature();

currentClassName()

Returns the fully qualified type name (i.e. including the namespace) of the type containing the function call.

method currentClassName(): String;
string currentClassName()
func currentClassName() -> String
string currentClassName()