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

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

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