public void Log_NewMessage(LogEntery logEntery) { if (logEntery.showExternal) { foreach (string line in logEntery.GetTextAsArray()) { ShowInfo(line, LogType.Normal); } } }
private static void SaveToFile(LogEntery logEntery) { // TODO: add methot to handle new day if (tw != null) { tw.WriteLine(string.Format("{0} [{1}] [{2}] [{3}] {4}", logEntery.dateTime.ToLongTimeString(), logEntery.logType, logEntery.from, logEntery.action, logEntery.text.Trim().Equals("") ? "" : "\r\n" + logEntery.text)); } }
public static void Write(LogEntery logEntery) { // This call enters LogEntery directili in array, good for calling from external app log.Add(logEntery); }
private static void NewLogDataEvent(LogEntery logEntery) { if (activeLog != null) { activeLog.ShowLog(); } if (saveLocal) { SaveToFile(logEntery); } if (NewMessage != null) { NewMessage(logEntery); } if (Log.OnLogTypeNumberChange != null) { Log.OnLogTypeNumberChange(logEntery.logType, LogTypeCounter.Increment(logEntery.logType)); } }
public static void Write(object text, object source, string action, LogType logType, bool showExternal) { LogEntery logEntery = new LogEntery(text, source.ToString(), action, logType, showExternal); log.Add(logEntery); NewLogDataEvent(logEntery); }
public static void Write(object text, Type type, string action, LogType logType) { LogEntery logEntery = new LogEntery(text, type.ToString(), action, logType); log.Add(logEntery); NewLogDataEvent(logEntery); }
public static void Write(object text, object source, string action, LogType logType) { LogEntery logEntery = new LogEntery(text, source.GetType().ToString(), action, logType); log.Add(logEntery); NewLogDataEvent(logEntery); }
public static void Write(string text, string source, LogType logType) { LogEntery logEntery = new LogEntery(text, source, logType); log.Add(logEntery); NewLogDataEvent(logEntery); }
public static void Write(string text) { LogEntery logEntery = new LogEntery(text); log.Add(logEntery); NewLogDataEvent(logEntery); }