Skip to content

Instantly share code, notes, and snippets.

@dixon
Created April 30, 2013 19:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dixon/5491269 to your computer and use it in GitHub Desktop.
Save dixon/5491269 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)
{
if (profiler == null) return null;
return profiler.Step(string.Format("{0} - {1}:{2}",
memberName,
Path.GetFileName(sourceFilePath),
sourceLineNumber));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment