public static void UnregisterTracer(this Je.ILogExpander exp, TraceListener tracer) { var i = IndexOfListeners(tracer); if (i < 0) { return; } lock (Trace.Listeners) { Trace.Listeners.RemoveAt(i); } }
public static void RegisterTracer(this Je.ILogExpander exp, TraceListener tracer) { if (tracer == null) { return; } var i = IndexOfListeners(tracer); if (i >= 0) { return; } lock (Trace.Listeners) { Trace.Listeners.Add(tracer); } }
public static void To(this Je.ILogExpander exp, object message) { if (message == null) { return; } var s = message.ToString(); if (string.IsNullOrWhiteSpace(s)) { return; } var holder = (message as LogHolder) ?? new LogHolder(message, new StackTrace()); Trace.WriteLine(holder); }
public static CommandMessage[] Of(this Je.ILogExpander exp, ICommand command) { return(command != null?command.GetLog() : new CommandMessage[0]); }