public IDisposable OverrideWriter(LogWriter new_out) { var old_out = Writer; Writer = new_out; var this_override = new DisposableAction(() => Writer = old_out); var debug_override = Debug.OverrideWriter(new_out); var info_override = Info.OverrideWriter(new_out); var warn_override = Warn.OverrideWriter(new_out); var error_override = Error.OverrideWriter(new_out); var fatal_override = Fatal.OverrideWriter(new_out); return(this_override + debug_override + info_override + warn_override + error_override + fatal_override); }