📄 exceptionshandler.cs
字号:
using System;
using System.Diagnostics;
namespace Helper.Debug
{
/// <summary>
/// This class is a central handler for exceptions.
/// </summary>
public sealed class ExceptionsHandler
{
#region Constructor
private ExceptionsHandler()
{
}
#endregion
#region Handle
[Conditional("DEBUG")]
public static void Handle(Exception exception, params object[] args)
{
string paramsText = "";
foreach (object val in args)
paramsText += " - " + val.ToString();
if (paramsText.Length > 0)
Console.WriteLine(exception.Message + '(' + paramsText + ")\n" + exception.StackTrace);
else
Console.WriteLine(exception.Message + '\n' + exception.StackTrace);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -