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

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

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