Created
January 31, 2016 11:57
-
-
Save tmr232/513d81917dea12686832 to your computer and use it in GitHub Desktop.
Debug prints in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// `using` directives | |
using System.Runtime.CompilerServices; | |
// Actual code | |
public static string GetLocation( | |
[CallerFilePath] string filePath = null, | |
[CallerLineNumber] int lineNumber = 0, | |
[CallerMemberName] string caller = null) | |
{ | |
return $"{filePath}:{lineNumber} {caller}"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment