|
|
@@ -1,4 +1,6 @@
|
|
|
-using System.Diagnostics;
|
|
|
+#if DEBUG
|
|
|
+using System.Diagnostics;
|
|
|
+#endif
|
|
|
using System.Globalization;
|
|
|
|
|
|
namespace PicView.Core.DebugTools;
|
|
|
@@ -30,14 +32,19 @@ public static class DebugHelper
|
|
|
/// </example>
|
|
|
public static void LogDebug(string className, string methodName, Exception exception)
|
|
|
{
|
|
|
+#if DEBUG
|
|
|
Debug.WriteLine(
|
|
|
$"\n[{DateTime.Now.ToString("T", CultureInfo.CurrentCulture)}] {className}.{methodName} exception: {exception.Message}");
|
|
|
Debug.WriteLine(exception.StackTrace + Environment.NewLine);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
+ /// <inheritdoc cref="LogDebug(string,string,System.Exception)"/>
|
|
|
public static void LogDebug(string className, string methodName, string exceptionMessage)
|
|
|
{
|
|
|
+#if DEBUG
|
|
|
Debug.WriteLine(
|
|
|
$"\n[{DateTime.Now.ToString("T", CultureInfo.CurrentCulture)}] {className}.{methodName} exception: {exceptionMessage}");
|
|
|
+#endif
|
|
|
}
|
|
|
}
|