3 using System.Runtime.CompilerServices;
5 namespace SiliconStudio.Core.Diagnostics
18 private CallerInfo(
string filePath,
string memberName,
int lineNumber)
21 MemberName = memberName;
22 LineNumber = lineNumber;
47 public static CallerInfo Get([CallerFilePath]
string sourceFilePath =
"", [CallerMemberName]
string memberName =
"", [CallerLineNumber]
int sourceLineNumber = 0)
49 return new CallerInfo(sourceFilePath, memberName, sourceLineNumber);
54 return string.Format(
"{0}:{1}:{2}", FilePath, MemberName, LineNumber);
A class to store Caller Information attributes.
readonly int LineNumber
Line number in the source file at which the method is called.
readonly string FilePath
Full path of the source file that contains the caller. This is the file path at compile time...
override string ToString()
static CallerInfo Get([CallerFilePath] string sourceFilePath="", [CallerMemberName] string memberName="", [CallerLineNumber] int sourceLineNumber=0)
Gets the caller information.
readonly string MemberName
Method or property name of the caller. See Member Names later in this topic.