Пример #1
0
        private static string GetEventID(this eventID eventID, DateTime start, DateTime stop, int code)
        {
            TimeSpan ts     = stop - start;
            int      cur_ms = (int)ts.TotalMilliseconds;

            return(String.Format("eventID:{0}, запущен:{1}, остановлен:{2}, время выполнения (мс): {3}, код выполнения: {4}", eventID.ToString(), start, stop, cur_ms, code));
        }
Пример #2
0
        private static string GetServices(this service service, eventID eventID, string description, DateTime start, DateTime stop, int code)
        {
            TimeSpan ts     = stop - start;
            int      cur_ms = (int)ts.TotalMilliseconds;

            return(String.Format("service:{0}, eventID:{1}, описание:{2}, запущен:{3}, остановлен:{4}, время выполнения (мс): {5}, код выполнения: {6}", service.ToString(), eventID.ToString(), description, start, stop, cur_ms, code));
        }
Пример #3
0
 public static void WriteInformation(this string message, eventID eventID, bool elog, bool dblog, bool flog)
 {
     if (elog)
     {
         message.SaveInformationToEventLogs(eventID);
     }
     if (dblog)
     {
         message.SaveInformationToDB(eventID);
     }
     if (flog)
     {
         message.SaveInformationToFile(eventID);
     }
 }
Пример #4
0
 public static void WriteWarning(this string message, service service, eventID eventID, bool elog, bool dblog, bool flog)
 {
     if (elog)
     {
         message.SaveWarningToEventLogs(service, eventID);
     }
     if (dblog)
     {
         message.SaveWarningToDB(service, eventID);
     }
     if (flog)
     {
         message.SaveWarningToFile(service, eventID);
     }
 }
Пример #5
0
 public static void ErrorLog(this string message, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("\neventID: {0}\nError: {1}", eventID, message));
     if (elog)
     {
         message.ErrorToEvent(eventID);
     }
     if (dblog)
     {
         message.ErrorToDB(eventID);
     }
     if (flog)
     {
         message.ErrorToFile(eventID);
     }
 }
Пример #6
0
 public static void WarningLog(this string message, service service, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("\nservice: {0}\neventID: {1}\nWarning: {2}", service, eventID, message));
     if (elog)
     {
         message.WarningToEvent(service, eventID);
     }
     if (dblog)
     {
         message.WarningToDB(service, eventID);
     }
     if (flog)
     {
         message.WarningToFile(service, eventID);
     }
 }
Пример #7
0
 public static void ExceptionLog(this Exception ex, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("\neventID: {0}\nException: {1}", eventID, ex));
     if (elog)
     {
         ex.ExceptionToEvent(eventID);
     }
     if (dblog)
     {
         ex.ExceptionToDB(eventID);
     }
     if (flog)
     {
         ex.ExceptionToFile(eventID);
     }
 }
Пример #8
0
 public static void ServicesToLog(this service service, eventID eventID, DateTime start, DateTime stop, int code, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format(GetServices(service, eventID, start, stop, code)));
     if (elog)
     {
         service.GetServices(eventID, start, stop, code).WarningToEvent(service);       // в лог записывается как событие Warning
     }
     if (dblog)
     {
         service.ServicesToDB(eventID, start, stop, code);
     }
     if (flog)
     {
         service.GetServices(eventID, start, stop, code).DebugToFile();
     }
 }
Пример #9
0
 public static void WriteError(this string message, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("/nError:{0}", message));
     if (elog)
     {
         message.SaveErrorToEventLogs(eventID);
     }
     if (dblog)
     {
         message.SaveErrorToDB(eventID);
     }
     if (flog)
     {
         message.SaveErrorToFile(eventID);
     }
 }
Пример #10
0
 public static void EventIDToLog(this eventID eventID, DateTime start, DateTime stop, int code, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format(GetEventID(eventID, start, stop, code)));
     if (elog)
     {
         eventID.GetEventID(start, stop, code).WarningToEvent(eventID);       // в лог записывается как событие Warning
     }
     if (dblog)
     {
         eventID.GetEventID(start, stop, code);
     }
     if (flog)
     {
         eventID.GetEventID(start, stop, code).DebugToFile();
     }
 }
Пример #11
0
 public static void WriteError(this Exception ex, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("/nException{0}", ex.ToString()));
     if (elog)
     {
         ex.SaveErrorToEventLogs(eventID);
     }
     if (dblog)
     {
         ex.SaveErrorToDB(eventID);
     }
     if (flog)
     {
         ex.SaveErrorToFile(eventID);
     }
 }
Пример #12
0
 public static string GetSource(service service, eventID eventID)
 {
     return(String.Format("[service.{0}, eventID.{1}] ", service, eventID));
 }
Пример #13
0
 public static void InformationToEvent(this string log, service service, eventID eventID)
 {
     log.InformationToEvent((service == service.Null ? (int?)null : (int)service), (eventID == eventID.Null ? (int?)null : (int)eventID));
 }
Пример #14
0
 public static void EventLog(this string events, EventStatus status, eventID eventID)
 {
     events.EventLog(status, service.Null, eventID, _eLogEvent, _dbLogEvent, _fLogEvent);
 }
Пример #15
0
 public static void EventLog(this string events, string status, service service, eventID eventID)
 {
     events.EventLog(status, service, eventID, _eLogEvent, _dbLogEvent, _fLogEvent);
 }
Пример #16
0
 public static void EventLog(this string events, EventStatus status, eventID eventID, bool elog, bool dblog, bool flog)
 {
     events.EventLog(status, service.Null, eventID, elog, dblog, flog);
 }
Пример #17
0
        public static void EventLog(this string events, EventStatus status, service service, eventID eventID, bool elog, bool dblog, bool flog)
        {
            Console.WriteLine(String.Format("\nservice: {0}\neventID: {1}\nevents: {2}\nstatus: {3}", service, eventID, events, status));

            if (elog)
            {
                (events + ", status:" + status).WarningToEvent(service, eventID);       // в лог записывается как событие Warning
            }
            if (dblog)
            {
                events.EventToDB(status, service, eventID);
            }
            if (flog)
            {
                (events + ", status:" + status).WarningToFile(service, eventID);
            }
        }
Пример #18
0
 public static void SaveErrorToFile(this string log, eventID eventID)
 {
     (GetSource(service.Null, eventID) + log).SaveErrorToFile();
 }
Пример #19
0
 static public long EventIDToDB(this eventID eventID, string description, DateTime start, DateTime stop, int code)
 {
     return(((int?)eventID).EventIDToDB(description, start, stop, code));
 }
Пример #20
0
 public static void ExceptionLog(this Exception ex, string message, eventID eventID)
 {
     ex.ExceptionLog(message, eventID, _eLogException, _dbLogException, _fLogException);
 }
Пример #21
0
 public static void ExceptionLog(this Exception ex, string message, service service, eventID eventID, bool elog, bool dblog, bool flog)
 {
     Console.WriteLine(String.Format("\nservice: {0}\neventID: {1}\nmessage: {2}\nException: {3}", service, eventID, message, ex));
     if (elog)
     {
         ex.ExceptionToEvent(message, service, eventID);
     }
     if (dblog)
     {
         ex.ExceptionToDB(message, service, eventID);
     }
     if (flog)
     {
         ex.ExceptionToFile(message, service, eventID);
     }
 }
Пример #22
0
 public static void ExceptionToFile(this Exception ex, eventID eventID)
 {
     ex.ExceptionToFile(GetSource(service.Null, eventID));
 }
Пример #23
0
 static public long ServicesToDB(this service service, eventID eventID, string description, DateTime start, DateTime stop, int code)
 {
     return(((int?)service).ServicesToDB((int?)eventID, description, start, stop, code));
 }
Пример #24
0
 public static void ExceptionLog(this Exception ex, eventID eventID)
 {
     ex.ExceptionLog(eventID, _eLogException, _dbLogException, _fLogException);
 }
Пример #25
0
 public static void SaveErrorToFile(this Exception ex, eventID eventID)
 {
     GetSource(service.Null, eventID).SaveError(ex);
 }
Пример #26
0
 public static void ExceptionMethodLog(this Exception ex, string method, eventID eventID, bool elog, bool dblog, bool flog)
 {
     ex.ExceptionLog(GetMessageMethod(method), eventID, elog, dblog, flog);
 }
Пример #27
0
 public static void SaveWarningToFile(this string log, service service, eventID eventID)
 {
     (GetSource(service, eventID) + log).SaveWarningToFile();
 }
Пример #28
0
 public static void ExceptionMethodLog(this Exception ex, string method, eventID eventID)
 {
     ex.ExceptionMethodLog(method, eventID, _eLogException, _dbLogException, _fLogException);
 }
Пример #29
0
 public static void SaveErrorToFile(this Exception ex, string user_message, service service, eventID eventID)
 {
     (GetSource(service, eventID) + user_message).SaveError(ex);
 }
Пример #30
0
 public static void EventToDB(this string events, EventStatus status, service service, eventID eventID)
 {
     events.EventToDB(status, (service == service.Null ? (int?)null : (int)service), (eventID == eventID.Null ? (int?)null : (int)eventID));
 }