public static Action <BehaviorLogEntry> RegisterLogger(BehaviorLogger logger) { if (logger.Name == null) { throw new ArgumentNullException("logger.Name is null"); } return(logPublisher.OnNext); }
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 }