Пример #1
0
 public void SetPriority(eLogPriority pPriority)
 {
     if (pPriority != eLogPriority.NONE)
     {
         _priority = pPriority;
     }
 }
Пример #2
0
        /// <summary>
        /// Description : Get log from priority
        /// </summary>
        /// <param name="pPriority"></param>
        /// <returns></returns>
        public static List <Log> GetLogFromPriority(eLogPriority pPriority)
        {
            List <Log> lResult = new List <Log>();

            foreach (Log lLog in _allLogs)
            {
                if (lLog.GetLogPriority() == pPriority)
                {
                    lResult.Add(lLog);
                }
            }

            return(lResult);
        }
Пример #3
0
        /// <summary>
        /// Description : Error Message in Custom Window ( Console Service Window )
        /// </summary>
        public static void Error(string pTitle, eLogPriority pPriority = eLogPriority.NONE, string pMessage = "")
        {
            StackTrace stackTrace = new StackTrace(true);

            // Declare new log
            Log _newLog = new Log();

            _newLog.SetId(_errors.Count + 1);
            _newLog.SetMessage(pMessage);
            _newLog.SetTitle(pTitle);
            _newLog.SetType(eLogType.ERROR);
            _newLog.SetPriority(pPriority);
            _newLog.SetStack(GetStack(stackTrace));

            // Add log in list
            _errors.Add(_newLog);
            _allLogs.Add(_newLog);
        }