Ejemplo n.º 1
0
        public override void Activate()
        {
            LogInternal.Debug(declaringType, "Debug - Activating options...");
            LogInternal.Warn(declaringType, "Warn - Activating options...");
            LogInternal.Error(declaringType, "Error - Activating options...");

            base.Activate();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
 protected override void append(IRender render, object loggingEvent)
 {
     LogInternal.Debug(declaringType, "Debug - Appending...");
     LogInternal.Warn(declaringType, "Warn - Appending...");
     LogInternal.Error(declaringType, "Error - Appending...");
 }