Class ObservableLoggingMixin
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Extension methods to assist with Logging.
- Inheritance
-
Observable
Logging Mixin
Methods
Log<T, TObj>(IObservable<T>, TObj, string?, Func<T, string>?)
Logs an Observable to Splat's Logger.
public static IObservable<T> Log<T, TObj>(this IObservable<T> @this, TObj logObject, string? message = null, Func<T, string>? stringifier = null) where TObj : IEnableLogger
Parameters
thisIObservable<T>The source observable to log to splat.
logObjectTObjThe hosting class, usually 'this'.
messagestringAn optional method.
stringifierFunc<T, string>An optional Func to convert Ts to strings.
Returns
- IObservable<T>
The same Observable.
Type Parameters
TThe type.
TObjThe object type.
LoggedCatch<T, TObj>(IObservable<T>, TObj, IObservable<T>?, string?)
Like Catch, but also prints a message and the error to the log.
public static IObservable<T> LoggedCatch<T, TObj>(this IObservable<T> @this, TObj klass, IObservable<T>? next = null, string? message = null) where TObj : IEnableLogger
Parameters
thisIObservable<T>The source observable to log to splat.
klassTObjThe hosting class, usually 'this'.
nextIObservable<T>The Observable to replace the current one OnError.
messagestringAn error message to print.
Returns
- IObservable<T>
The same Observable.
Type Parameters
TThe type.
TObjThe object type.
LoggedCatch<T, TObj, TException>(IObservable<T>, TObj, Func<TException, IObservable<T>>, string?)
Like Catch, but also prints a message and the error to the log.
public static IObservable<T> LoggedCatch<T, TObj, TException>(this IObservable<T> @this, TObj klass, Func<TException, IObservable<T>> next, string? message = null) where TObj : IEnableLogger where TException : Exception
Parameters
thisIObservable<T>The source observable to log to splat.
klassTObjThe hosting class, usually 'this'.
nextFunc<TException, IObservable<T>>A Func to create an Observable to replace the current one OnError.
messagestringAn error message to print.
Returns
- IObservable<T>
The same Observable.
Type Parameters
TThe type.
TObjThe object type.
TExceptionThe exception type.