/// <summary> /// Noncritical problem. /// </summary> static public ILogEntity NewWarning() { ILogEntity logEntity = Instance.CreateLogEntity(TraceEventType.Warning); logEntity.Bypass(); return(logEntity); }
public async Task Insert(ILogEntity log) { using (var conn = new SqlConnection(_connectionString)) { await conn.ExecuteAsync( $"insert into {_tableName} ({GetColumns}) values ({GetFields})", log); } }
// <summary> /// Evidence/Informational message. /// </summary> static public ILogEntity NewInformation(string category, string message, object xmlMessage) { ILogEntity logEntity = Instance.CreateLogEntity(TraceEventType.Information); logEntity.Category = category; logEntity.Message = message; logEntity.XmlMessage = xmlMessage; return(logEntity); }
public void Flush(ILogEntity log) { try { foreach (var src in Source) { src.TraceData(log.LogMode, log.Idx, log); } } catch (Exception err) { Debug.Write("Support.Log.Flush() " + err.Message); }; }
public virtual void CheckCodeCheckOute(ILogEntity entitty) { if (entitty.ModifieUserId != CurrentUserManager.Id) { var modifyUser = AuthorizeManager.GetUserInfoById(entitty.ModifieUserId ?? 0); if (modifyUser != null) { throw new CheckOutRecordException(modifyUser.Key); } else { throw new CheckOutRecordException("XXXXXX"); } } }
public override int SaveChanges() { var entities = ChangeTracker.Entries() .Where(e => e.State == EntityState.Added); foreach (var entity in entities) { ILogEntity logEntity = entity.Entity as ILogEntity; if (logEntity != null) { logEntity.SetCreateTime(); } } return(base.SaveChanges()); }
public void Write(ILogEntity logEntity) { System.Diagnostics.Debug.WriteLine(logEntity.ToString()); }
private static string BuildMessage(ILogEntity logEntity) { return(string.Format("[{0}][{1}] {2}", logEntity.Function, logEntity.AccountName, logEntity.Message)); }
public void WriteLog(LogEnum name, ILogEntity logEntity) { WriteLog(name, logEntity.Level, logEntity.GetLogContext()); }
public string Insert(ILogEntity logEntity) { LogCollection.InsertOne(logEntity); return(logEntity.ToJSON()); }
private void WriteLog(ILogEntity logEntity) { LogWriter.Write(logEntity); }
public void Log(ILogEntity logEntity) { WriteLog(logEntity); }