예제 #1
0
        public static Action <BehaviorLogEntry> RegisterLogger(BehaviorLogger logger)
        {
            if (logger.Name == null)
            {
                throw new ArgumentNullException("logger.Name is null");
            }

            return(logPublisher.OnNext);
        }
예제 #2
0
        public static IObservable <T> Debug <T>(this IObservable <T> source, BehaviorLogger logger)
        {
#if DEBUG
            return(source.Materialize()
                   .Do(x => logger.Debug(x.ToString()))
                   .Dematerialize()
                   .DoOnCancel(() => logger.Debug("OnCancel"))
                   .DoOnSubscribe(() => logger.Debug("OnSubscribe")));
#else
            return(source);
#endif
        }