An asynchronous logger
Logging and Audit trail is an important cross-cutting or horizontal concern in the day-to-day application that we create. There are various third-party tools that we leverage; and we have seen how to write one ourselves in depth in Chapter 3, A Logging Library. Here, we will see how to impart reactive behavior to a custom-logging component.
We will use the same spell checker example in the preceding section and see how to integrate logging capability into the existing code base.
We will start off by initializing the log collection as a BindingList
, the same way we got the corrections/suggestions initialized:
class SpellCheckerViewModel : INotifyPropertyChanged { private BindingList<string> _logs; private ISubject<string> _logChanged; public BindingList<string> Logs { get { return this._logs; } set { if (value != this._logs...