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)); }
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)); }
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); } }
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); } }
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); } }
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); } }
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); } }
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(); } }
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); } }
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(); } }
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); } }
public static string GetSource(service service, eventID eventID) { return(String.Format("[service.{0}, eventID.{1}] ", service, eventID)); }
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)); }
public static void EventLog(this string events, EventStatus status, eventID eventID) { events.EventLog(status, service.Null, eventID, _eLogEvent, _dbLogEvent, _fLogEvent); }
public static void EventLog(this string events, string status, service service, eventID eventID) { events.EventLog(status, service, eventID, _eLogEvent, _dbLogEvent, _fLogEvent); }
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); }
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); } }
public static void SaveErrorToFile(this string log, eventID eventID) { (GetSource(service.Null, eventID) + log).SaveErrorToFile(); }
static public long EventIDToDB(this eventID eventID, string description, DateTime start, DateTime stop, int code) { return(((int?)eventID).EventIDToDB(description, start, stop, code)); }
public static void ExceptionLog(this Exception ex, string message, eventID eventID) { ex.ExceptionLog(message, eventID, _eLogException, _dbLogException, _fLogException); }
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); } }
public static void ExceptionToFile(this Exception ex, eventID eventID) { ex.ExceptionToFile(GetSource(service.Null, eventID)); }
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)); }
public static void ExceptionLog(this Exception ex, eventID eventID) { ex.ExceptionLog(eventID, _eLogException, _dbLogException, _fLogException); }
public static void SaveErrorToFile(this Exception ex, eventID eventID) { GetSource(service.Null, eventID).SaveError(ex); }
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); }
public static void SaveWarningToFile(this string log, service service, eventID eventID) { (GetSource(service, eventID) + log).SaveWarningToFile(); }
public static void ExceptionMethodLog(this Exception ex, string method, eventID eventID) { ex.ExceptionMethodLog(method, eventID, _eLogException, _dbLogException, _fLogException); }
public static void SaveErrorToFile(this Exception ex, string user_message, service service, eventID eventID) { (GetSource(service, eventID) + user_message).SaveError(ex); }
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)); }