Beispiel #1
0
        private static ScriptExecutor CreateScriptExecutor(bool debug)
        {
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(
                new ConsoleLoggerProvider(
                    (text, logLevel) => logLevel >= (debug ? LogLevel.Debug : LogLevel.Warning), true));
            return(new ScriptExecutor(ScriptProjectProvider.Create(loggerFactory), loggerFactory));
        }
Beispiel #2
0
        private static ScriptExecutor CreateScriptExecutor(bool debug)
        {
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(
                new ConsoleLoggerProvider(
                    (text, logLevel) => logLevel >= (debug ? LogLevel.Debug : LogLevel.Error), true));
            var scriptParser              = new ScriptParser(loggerFactory);
            var scriptProjectProvider     = new ScriptProjectProvider(scriptParser, loggerFactory);
            var runtimeDependencyResolver = new RuntimeDependencyResolver(new CommandRunner(loggerFactory), loggerFactory);

            return(new ScriptExecutor(scriptProjectProvider, runtimeDependencyResolver, loggerFactory));
        }