ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Fast Debug For Visual Studio

Prints the message in debug screen in visual studio. Short way for debugging by a short name (p). p means print

Source

/// <summary>
/// Prints the message in debug screen in visual studio. Short way for debugging.
/// </summary>
public static void p(object message , [CallerLineNumber] int line = -1, [CallerMemberName] string function = "null", [CallerFilePath] string filePath = "null")
{
    string file = System.IO.Path.GetFileName(filePath);

    Debug.WriteLine("");
    Debug.WriteLine("↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓");
    Debug.WriteLine("Debug adress: " + file + " Line: " + line + " Function: " + function);
    Debug.WriteLine(message);
    Debug.WriteLine("↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑");
    Debug.WriteLine("");
}

Example

p("something to write");

Author: Fivza

Submitted on: 17 jul. 2024

Language: csharp

Type: System.Debug

Views: 390