public static IDisposable AddLoggersTemporarily(Action<string> debug, Action<string> info, Action<string> warn, Action<string> error)
{
var currentDebug = WriteDebug;
var currentInfo = WriteInfo;
var currentWarn = WriteWarning;
var currentError = WriteError;
SetLoggers(s =>
{
debug(s);
currentDebug(s);
}, s =>
{
info(s);
currentInfo(s);
}, s =>
{
warn(s);
currentWarn(s);
}, s =>
{
error(s);
currentError(s);
});
return new ActionDisposable(() =>
{
WriteDebug = currentDebug;
WriteInfo = currentInfo;
WriteWarning = currentWarn;
WriteError = currentError;
});
}