コード例 #1
0
 public static void Log(LogEntryType type, LogActionType action, string log, string metadata)
 {
     WriteLog($"LogEntryType: {type}\n" +
              $"LogActionType : {action}\n" +
              $"Log : {log}\n" +
              $"Metadata : {metadata}");
 }
コード例 #2
0
ファイル: AuditLogService.cs プロジェクト: jborunda/pam
        public async Task Append(int employeeId, LogActionType actionType, LogResourceType resourceType, int resourceId, string message,
                                 string oldValue = null, string newValue = null)
        {
            var logEntry = new AuditLogEntry(employeeId, actionType, resourceType, resourceId, message, oldValue, newValue);

            _dbContext.AuditLog.Add(logEntry);
            await _dbContext.SaveChangesAsync();
        }
コード例 #3
0
 public LogFilter(string actionName, string menuName, LogActionType logActionType, string description = "")
 {
     Log = new LogModel()
     {
         ActionName  = actionName,
         MenuName    = menuName,
         ActionType  = logActionType.ToString(),
         Description = description
     };
 }
コード例 #4
0
        public int LogCount(EntityType type, LogActionType action, DateTime?start, DateTime?end)
        {
            IQueryable <ActionOnLogData> query = dbSet.Where(log => log.ActionType == action && log.EntityType == type);

            if (start.HasValue && end.HasValue && end.Value > DateTime.MinValue)
            {
                query = query.Where(log => log.DateTime > start.Value && log.DateTime < end.Value);
            }
            return(query.GroupBy(log => log.EntityId).Count());
        }
コード例 #5
0
ファイル: Logger.cs プロジェクト: AbabeiAndrei/WProject
 public static void Log(LogEntryType type, LogActionType action, string log, string metadata)
 {
     if (WriteInConsole)
         ConsoleLogger.Log(type, action, log, metadata);
     if (WriteInDiagnostics)
         DiagnosticLogger.Log(type, action, log, metadata);
     if (WriteInDb)
         DbLog.Log(type, action, log, metadata);
     if (WriteInFile)
         FileLogger.Log(type, action, log, metadata, LogFilePath);
 }
コード例 #6
0
ファイル: AuditLogEntry.cs プロジェクト: jborunda/pam
 public AuditLogEntry(int employeeId, LogActionType actionType, LogResourceType resourceType, int resourceId, string message,
                      string oldValue = null, string newValue = null)
 {
     EmployeeId   = employeeId;
     ActionType   = actionType;
     ResourceType = resourceType;
     ResourceId   = resourceId;
     Message      = message;
     Timestamp    = DateTime.Now;
     OldValue     = oldValue;
     NewValue     = newValue;
 }
コード例 #7
0
        public RepositoryPagingResponse <LeadMusicLog> GetMusicLogByAction(LogActionType action, DateTime start, DateTime end, int skip, int take)
        {
            RepositoryPagingResponse <LeadMusicLog> res = new RepositoryPagingResponse <LeadMusicLog>();
            string queryString = null;

            queryString = String.Format(queryLeadMusicFormat, (int)action, start.ToString("yyyy-MM-dd HH:mm:ss"), end.ToString("yyyy-MM-dd  HH:mm:ss"));
            var query = ((PaskolDbContext)_uow.context).Database.SqlQuery <LeadMusicLog>(queryString);

            res.TotalResults = query.Count();
            res.Entities     = query.OrderByDescending(l => l.Count).Skip(skip).Take(take);
            return(res);
        }
コード例 #8
0
 /// <summary>
 /// Adds and item to the log.
 /// </summary>
 /// <param name="ActionType">Type of action which this log pretains to.</param>
 /// <param name="ParamObject">Objects containing information needed to generate a message.</param>
 public void AddItem(LogActionType ActionType, params object[] ParamObject)
 {
     string LogMessage = string.Empty;
     switch (ActionType) {
         case LogActionType.Information:
             if (ParamObject[0].GetType() == typeof(string)) {
                 LogMessage = ParamObject[0].ToString();
             }
             break;
         case LogActionType.ShoeShuffle:
             if (ParamObject[0].GetType() == typeof(ShoeViewModel)) {
                 ShoeViewModel tempShoe = (ShoeViewModel)ParamObject[0];
                 LogMessage = string.Format("Shuffled {0} deck shoe (Mode: {1}).", m_MasterParent.HouseRulesVM.DecksInShoe, m_MasterParent.HouseRulesVM.ShuffleMode.ToString());
             }
             break;
         case LogActionType.Benchmark:
             if (ParamObject[0].GetType() == typeof(BenchmarkResults)) {
                 BenchmarkResults tempResults = (BenchmarkResults)ParamObject[0];
                 LogMessage = string.Format("Benchmark \"{0}\" Finished: {1}/sec", tempResults.Name, tempResults.IterationsPerSecond.ToString());
             }
             break;
     }
     LogItem tempLI = new LogItem();
     tempLI.Type = ActionType;
     tempLI.Message = LogMessage;
     tempLI.Time = DateTime.Now;
     LogItems.Add(tempLI);
     if (!m_MasterParent.HouseRulesVM.FastMode) { OnPropertyChanged("Log"); }
 }
コード例 #9
0
ファイル: Helper.cs プロジェクト: nintran1995/MMOApp
 internal static string GetActionLogEnumDescription(LogActionType type) => type.AsString(EnumFormat.Description);
コード例 #10
0
 public static void Log(LogEntryType type, LogActionType action, string log)
 {
     WriteLog($"LogEntryType: {type}\n" +
              $"LogActionType : {action}\n" +
              $"Log : {log}\n");
 }
コード例 #11
0
 /// <summary>
 /// Gell all
 /// </summary>
 /// <returns></returns>
 public static Expression <Func <ActionLog, bool> > WithActionTypeAct(LogActionType actionType)
 {
     return(al => al.ActionType == (byte)actionType);
 }
コード例 #12
0
ファイル: FileLogger.cs プロジェクト: AbabeiAndrei/WProject
 public static void Log(LogEntryType type, LogActionType action, string log, string metadata, string filePath)
 {
     throw new NotImplementedException();
 }