GitVersion.Logger.AddLoggersTemporarily C# (CSharp) Method

AddLoggersTemporarily() public static method

public static AddLoggersTemporarily ( Action debug, Action info, Action warn, Action error ) : IDisposable
debug Action
info Action
warn Action
error Action
return IDisposable
        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;
            });
        }