A logging adapter implementation publishing log events to the event stream.
Наследование: LoggingAdapterBase
Пример #1
0
        public void A_Log_on_source_must_allow_passing_in_custom_LoggingAdapter()
        {
            var log = new BusLogging(Sys.EventStream, "com.exmaple.ImportantLogger", LogType, new DefaultLogMessageFormatter());

            Source.Single(42)
                .Log("flow-5", log: log)
                .RunWith(Sink.Ignore<int>(), Materializer);

            var msgs = LogProbe.ReceiveN(2).Cast<Debug>().ToArray();
            msgs.All(m => m.LogSource.Equals("com.exmaple.ImportantLogger")).Should().BeTrue();
            msgs.All(m => m.LogClass == LogType).Should().BeTrue();
            msgs[0].Message.ToString().Should().Be("[flow-5] Element: 42");
            msgs[1].Message.ToString().Should().Be("[flow-5] Upstream finished.");
        }