Exemplo n.º 1
0
        /// <summary>
        /// Noncritical problem.
        /// </summary>
        static public ILogEntity NewWarning()
        {
            ILogEntity logEntity = Instance.CreateLogEntity(TraceEventType.Warning);

            logEntity.Bypass();
            return(logEntity);
        }
Exemplo n.º 2
0
 public async Task Insert(ILogEntity log)
 {
     using (var conn = new SqlConnection(_connectionString))
     {
         await conn.ExecuteAsync(
             $"insert into {_tableName} ({GetColumns}) values ({GetFields})", log);
     }
 }
Exemplo n.º 3
0
        // <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);
        }
Exemplo n.º 4
0
 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");
         }
     }
 }
Exemplo n.º 6
0
        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());
        }
Exemplo n.º 7
0
 public void Write(ILogEntity logEntity)
 {
     System.Diagnostics.Debug.WriteLine(logEntity.ToString());
 }
Exemplo n.º 8
0
 private static string BuildMessage(ILogEntity logEntity)
 {
     return(string.Format("[{0}][{1}] {2}", logEntity.Function, logEntity.AccountName, logEntity.Message));
 }
Exemplo n.º 9
0
 public void WriteLog(LogEnum name, ILogEntity logEntity)
 {
     WriteLog(name, logEntity.Level, logEntity.GetLogContext());
 }
Exemplo n.º 10
0
        public string Insert(ILogEntity logEntity)
        {
            LogCollection.InsertOne(logEntity);

            return(logEntity.ToJSON());
        }
Exemplo n.º 11
0
 public void WriteLog(LogEnum name, ILogEntity logEntity)
 {
     WriteLog(name, logEntity.Level, logEntity.GetLogContext());            
 }
Exemplo n.º 12
0
 private void WriteLog(ILogEntity logEntity)
 {
     LogWriter.Write(logEntity);
 }
Exemplo n.º 13
0
 public void Log(ILogEntity logEntity)
 {
     WriteLog(logEntity);
 }