PowerToys/Wox.Infrastructure/Logger/Log.cs
bao-qian c456ef9118 Fix namespace
bug introduced since  e037e88
2015-11-09 03:59:20 +00:00

47 lines
1.0 KiB
C#

using NLog;
using Wox.Infrastructure.Exception;
namespace Wox.Infrastructure.Logger
{
public class Log
{
private static NLog.Logger logger = LogManager.GetCurrentClassLogger();
public static void Error(System.Exception e)
{
#if DEBUG
throw e;
#else
logger.Error(e.Message + "\r\n" + e.StackTrace);
#endif
}
public static void Debug(string msg)
{
System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}");
logger.Debug(msg);
}
public static void Info(string msg)
{
System.Diagnostics.Debug.WriteLine($"INFO: {msg}");
logger.Info(msg);
}
public static void Warn(string msg)
{
System.Diagnostics.Debug.WriteLine($"WARN: {msg}");
logger.Warn(msg);
}
public static void Fatal(System.Exception e)
{
#if DEBUG
throw e;
#else
logger.Fatal(ExceptionFormatter.FormatExcpetion(e));
#endif
}
}
}