Inheritance: System.Diagnostics.TraceListener
Exemplo n.º 1
0
        public void TraceListenerCounterTest()
        {
            TraceListenerCounter listTraceListener = new TraceListenerCounter();

            Trace.Listeners.Clear();
            Trace.Listeners.Add(listTraceListener);

            Trace.Write("Hello");
            Trace.Write("World");

            Assert.AreEqual(2, listTraceListener.Count);
        }
Exemplo n.º 2
0
        public void TraceListenerCounterTest()
        {
            TraceListenerCounter listTraceListener = new TraceListenerCounter();

            Trace.Listeners.Clear();
            Trace.Listeners.Add(listTraceListener);

            Trace.Write("Hello");
            Trace.Write("World");

            Assert.AreEqual(2, listTraceListener.Count);
        }
Exemplo n.º 3
0
        public void EmitInternalMessages()
        {
            TraceListenerCounter listTraceListener = new TraceListenerCounter();
            Trace.Listeners.Clear();
            Trace.Listeners.Add(listTraceListener);
            LogLog.Error(GetType(), "Hello");
            LogLog.Error(GetType(), "World");
            Trace.Flush();
            Assert.AreEqual(2, listTraceListener.Count);

            LogLog.EmitInternalMessages = false;

            LogLog.Error(GetType(), "Hello");
            LogLog.Error(GetType(), "World");
            Assert.AreEqual(2, listTraceListener.Count);
        }
Exemplo n.º 4
0
        public void EmitInternalMessages()
        {
            TraceListenerCounter listTraceListener = new TraceListenerCounter();

            Trace.Listeners.Clear();
            Trace.Listeners.Add(listTraceListener);
            LogLog.Error(GetType(), "Hello");
            LogLog.Error(GetType(), "World");
            Trace.Flush();
            Assert.AreEqual(2, listTraceListener.Count);

            LogLog.EmitInternalMessages = false;

            LogLog.Error(GetType(), "Hello");
            LogLog.Error(GetType(), "World");
            Assert.AreEqual(2, listTraceListener.Count);
        }