public override void Activate() { LogInternal.Debug(declaringType, "Debug - Activating options..."); LogInternal.Warn(declaringType, "Warn - Activating options..."); LogInternal.Error(declaringType, "Error - Activating options..."); base.Activate(); }
public void LogReceivedAdapter() { var messages = new List <LogInternal>(); using (new LogInternal.LogReceivedAdapter(messages)) { LogInternal.Debug(GetType(), "Won't be recorded"); LogInternal.Error(GetType(), "This will be recorded."); LogInternal.Error(GetType(), "This will be recorded."); } Assert.AreEqual(2, messages.Count); }
public void EmitInternalMessages() { TraceListenerCounter listTraceListener = new TraceListenerCounter(); Trace.Listeners.Clear(); Trace.Listeners.Add(listTraceListener); LogInternal.Error(GetType(), "Hello"); LogInternal.Error(GetType(), "World"); Trace.Flush(); Assert.AreEqual(2, listTraceListener.Count); try { LogInternal.InternalMessage = false; LogInternal.Error(GetType(), "Hello"); LogInternal.Error(GetType(), "World"); Assert.AreEqual(2, listTraceListener.Count); } finally { LogInternal.InternalMessage = true; } }
protected override void append(IRender render, object loggingEvent) { LogInternal.Debug(declaringType, "Debug - Appending..."); LogInternal.Warn(declaringType, "Warn - Appending..."); LogInternal.Error(declaringType, "Error - Appending..."); }