Skip to content

Instantly share code, notes, and snippets.

@mgravell
Created March 15, 2017 20:37
Show Gist options
  • Save mgravell/bde22f166f1a9ed1938543ac060d4ff5 to your computer and use it in GitHub Desktop.
Save mgravell/bde22f166f1a9ed1938543ac060d4ff5 to your computer and use it in GitHub Desktop.
/// <summary>
/// Does a Step with the location of caller as the label.
/// </summary>
public static IDisposable StepHere(
this MiniProfiler profiler,
[CallerMemberName] string memberName = "",
[CallerFilePath] string sourceFilePath = "",
[CallerLineNumber] int sourceLineNumber = 0) =>
profiler?.Step($"{memberName} - {Path.GetFileName(sourceFilePath)}:{sourceLineNumber.ToString()}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment