| | |
| | | using NLog.Config; |
| | | using NLog.Targets; |
| | | |
| | | namespace HH.WCS.Mobox3.DSZSH { |
| | | public class LogHelper |
| | | { |
| | | namespace HH.WCS.Mobox3.DSZSH.util { |
| | | public class LogHelper { |
| | | public static Dictionary<string, ILogger> loggers = new Dictionary<string, ILogger>(); |
| | | |
| | | #region 初始方法 ( Error 默认不使用 ) |
| | | public static void Debug(string message, string name = "") { |
| | | ILogger logger = null; |
| | | if (loggers.Keys.Contains(name)) { |
| | |
| | | logger.Error($"{message}{ex.StackTrace}"); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 自定义方法 |
| | | public static void Warn(string msg, string preLog = "") { |
| | |
| | | #endregion |
| | | } |
| | | |
| | | internal class LogFactory |
| | | { |
| | | internal class LogFactory { |
| | | /// <summary> |
| | | /// 通过配置文件配置日志 |
| | | /// </summary> |