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
this
IObservable<T>The source observable to log to splat.
logObject
TObjThe hosting class, usually 'this'.
message
stringAn optional method.
stringifier
Func<T, string>An optional Func to convert Ts to strings.
Returns
- IObservable<T>
The same Observable.
Type Parameters
T
The type.
TObj
The 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
this
IObservable<T>The source observable to log to splat.
klass
TObjThe hosting class, usually 'this'.
next
IObservable<T>The Observable to replace the current one OnError.
message
stringAn error message to print.
Returns
- IObservable<T>
The same Observable.
Type Parameters
T
The type.
TObj
The 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
this
IObservable<T>The source observable to log to splat.
klass
TObjThe hosting class, usually 'this'.
next
Func<TException, IObservable<T>>A Func to create an Observable to replace the current one OnError.
message
stringAn error message to print.
Returns
- IObservable<T>
The same Observable.
Type Parameters
T
The type.
TObj
The object type.
TException
The exception type.