コード例 #1
0
        public void WhenEventsAreNotConsumed_FactoryIsNotInvoked()
        {
            bool factoryInvoked = false;
            Func <StructuredLogEntry> factory = () =>
            {
                factoryInvoked = true;
                return(new StructuredLogEntry("test"));
            };

            var logEntryEvent = new StructuredLogEntryEvent(factory);

            Assert.False(factoryInvoked);
        }
コード例 #2
0
        private void OnLogEntry(StructuredLogEntryEvent logEvent)
        {
            string message = logEvent.LogEntry.ToJsonLineString();

            _traceWriter.Trace(message, TraceLevel.Verbose, null);
        }
コード例 #3
0
        private void OnLogEntry(StructuredLogEntryEvent logEvent)
        {
            string message = logEvent.LogEntry.ToJsonLineString();

            _writer.AppendLine(message);
        }