/// <summary> ///记录用户在处理业务时每一步操作行为,以及相关事务处理和数据信息访问等操作记录数据、系统日志等。 /// </summary> /// <param name="ll">日志级别</param> /// <param name="type">日志类型 0错误1增2改3删4登录5下载</param> /// <param name="content">日志内容</param> /// <param name="Remark">备注</param> public static void doLogs(LogsLevel ll, LogsType type, string content, string Remark) { //实例化日志内容 LogContent lc = new LogContent { HandleType = (int)type, Content = content, Remark = Remark }; //提交日志信息 //判定日志级别 switch (ll) { case LogsLevel.Info: log.Info(lc); break; case LogsLevel.Warn: log.Warn(lc); break; case LogsLevel.Error: log.Error(lc); break; case LogsLevel.Fatal: log.Fatal(lc); break; } }
public static void Log(string message, LogsLevel level) { if (Verbose <= level) { Logs[level].PrintAsync(message); } }
/// <summary> /// 日志记录 /// </summary> /// <param name="content">日志内容,内容不能为空</param> /// <param name="level">日志级别</param> public void Log(string content, LogsLevel level = LogsLevel.Information) { if (!content.IsNullOrEmpty()) { var log = new Logs { Content = content.Replace("{{Table}}", ""), Level = level, Type = typeof(TEntity).Name }; if (HttpWeb.HttpContext != null) { try { log.Url = HttpWeb.Url; log.Browser = HttpWeb.Browser; log.UserId = HttpWeb.UserId; log.IpAddress = HttpWeb.Ip; } catch { // ignored } } if (log.Type != "Logs") { Ioc.Resolve <ILogsService>().Add(log); } } }
static CoreHapticsUnityProxy() { #if UNITY_EDITOR isSupported = true; LogLevel = LogsLevel.Verbose; #else isSupported = Application.platform == RuntimePlatform.IPhonePlayer && _coreHapticsUnityIsSupport(); LogLevel = LogsLevel.None; #endif _coreHapticsRegisterCallback(HapticStoppedCallback); }
/// <summary> /// /// </summary> public SystemLogs() { CreateTime = DateTime.Now; Level = LogsLevel.L1; }