Ejemplo n.º 1
0
        private static void ConfigureLogging(Arguments arguments, ILog log)
        {
            if (arguments.Output == OutputType.BuildServer || arguments.LogFilePath == "console" || arguments.Init)
            {
                log.AddLogAppender(new ConsoleAppender());
            }

            if (arguments.LogFilePath != null && arguments.LogFilePath != "console")
            {
                log.AddLogAppender(new FileAppender(arguments.LogFilePath));
            }
        }
Ejemplo n.º 2
0
        private static void ConfigureLogging(GitVersionOptions gitVersionOptions, ILog log)
        {
            if (gitVersionOptions.Output.Contains(OutputType.BuildServer) || gitVersionOptions.LogFilePath == "console" || gitVersionOptions.Init)
            {
                log.AddLogAppender(new ConsoleAppender());
            }

            if (gitVersionOptions.LogFilePath != null && gitVersionOptions.LogFilePath != "console")
            {
                log.AddLogAppender(new FileAppender(gitVersionOptions.LogFilePath));
            }
        }
Ejemplo n.º 3
0
        public async Task Execute(Arguments arguments, CancellationToken cancellationToken)
        {
            if (arguments is null)
            {
                _helpWriter.Write();
                throw new FatalException("Arguments is null.");
            }

            if (arguments.IsVersion)
            {
                _versionWriter.Write(Assembly.GetExecutingAssembly());
                return;
            }

            if (arguments.IsHelp)
            {
                _helpWriter.Write();
                return;
            }

            // Configure Logging
            _log.AddLogAppender(new ConsoleAppender());

            if (arguments.LogFilePath != null)
            {
                _log.AddLogAppender(new FileAppender(arguments.LogFilePath));
            }

            if (!File.Exists(arguments.DacPacFilePath))
            {
                throw new FatalException($"DacPac FilePath '{arguments.DacPacFilePath}' does not exist!", true);
            }

            // Continue with Deployment
            _log.Info("Using DacPac: {0}", arguments.DacPacFilePath);

            if (arguments.Threads == 0)
            {
                _log.Debug("Threads value was 0, so using default value of 1.");
                arguments.Threads = 1;
            }

            await _execCommand.Execute(cancellationToken);
        }