public void Log(TAPManagerLogEvent e, String message, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0) { if (this.IsEventEnabled(e)) { string str = "[" + this.DateString() + "] TAPLib " + this.GetEventString(e) + " # " + message + " @ " + file + ":" + member + "(" + line + ")"; Debug.WriteLine(str); this._logs.Add(str); } }
private bool IsEventEnabled(TAPManagerLogEvent e) { if (this.enabledEvents.ContainsKey(e)) { return(this.enabledEvents[e]); } else { this.enabledEvents.Add(e, false); return(false); } }
private String GetEventString(TAPManagerLogEvent e) { switch (e) { case TAPManagerLogEvent.Error: return("ERROR"); case TAPManagerLogEvent.Fatal: return("FATAL"); case TAPManagerLogEvent.Info: return("info"); case TAPManagerLogEvent.Warning: return("warning"); } return(""); }
public void DisableEvent(TAPManagerLogEvent e) { this.enabledEvents[e] = false; }
public void EnableEvent(TAPManagerLogEvent e) { this.enabledEvents[e] = true; }