Example #1
0
 public Bounce()
 {
     LogFactory = new TaskLogFactory();
     LogOptions = new LogOptions {CommandOutput = false, LogLevel = LogLevel.Warning, ReportTargetEnd = true};
     ShellCommand = new ShellCommandExecutor(() => Log);
     TargetInvoker = new TargetInvoker(this);
 }
Example #2
0
 public TeamCityLog(TextWriter output, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
     : base(output, output, logOptions, logMessageFormatter)
 {
     this.Output = output;
     LogOptions = logOptions;
     TeamCityFormatter = new TeamCityFormatter();
 }
Example #3
0
 public Bounce(LogOptions logOptions)
 {
     LogFactory = new TaskLogFactory();
     LogOptions = logOptions;
     ShellCommand = new ShellCommandExecutor(() => Log);
     TargetInvoker = new TargetInvoker(this);
 }
Example #4
0
 public Log(TextWriter stdout, TextWriter stderr, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
 {
     Stdout = stdout;
     Stderr = stderr;
     LogOptions = logOptions;
     LogMessageFormatter = logMessageFormatter;
 }
Example #5
0
 public Log(TextWriter stdout, TextWriter stderr, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
 {
     Stdout              = stdout;
     Stderr              = stderr;
     LogOptions          = logOptions;
     LogMessageFormatter = logMessageFormatter;
 }
Example #6
0
 public ICommandLog Create(string command, string args, TextWriter stdout, TextWriter stderr, LogOptions logOptions)
 {
     if (logOptions.CommandOutput) {
         return new CommandLog(command, args, stdout, stderr);
     } else {
         return new NullCommandLog(args);
     }
 }
        public LogOptions ParseCommandLine(Arguments arguments)
        {
            var logOptions = new LogOptions {
                LogLevel = arguments.Parameter(LogLevelParameter, LogLevel.Warning),
                CommandOutput = arguments.Parameter(CommandOutputParameter, true),
            };

            SetLogOutput(arguments, logOptions);

            return logOptions;
        }
Example #8
0
        public LogOptions ParseCommandLine(Arguments arguments)
        {
            var logOptions = new LogOptions {
                LogLevel      = arguments.Parameter(LogLevelParameter, LogLevel.Warning),
                CommandOutput = arguments.Parameter(CommandOutputParameter, false),
            };

            SetLogOutput(arguments, logOptions);

            return(logOptions);
        }
        private void SetLogOutput(Arguments arguments, LogOptions logOptions)
        {
            var filename = arguments.Parameter<string>(LogFileParameter, null);

            if (filename != null) {
                var textWriter = File.AppendText(filename);
                textWriter.AutoFlush = true;
                logOptions.StdErr = textWriter;
                logOptions.StdOut = textWriter;
            } else {
                logOptions.StdErr = Console.Error;
                logOptions.StdOut = Console.Out;
            }
        }
Example #10
0
        private void SetLogOutput(Arguments arguments, LogOptions logOptions)
        {
            var filename = arguments.Parameter <string>(LogFileParameter, null);

            if (filename != null)
            {
                var textWriter = File.AppendText(filename);
                textWriter.AutoFlush = true;
                logOptions.StdErr    = textWriter;
                logOptions.StdOut    = textWriter;
            }
            else
            {
                logOptions.StdErr = Console.Error;
                logOptions.StdOut = Console.Out;
            }
        }
Example #11
0
 public TaskLog(TextWriter stdOut, TextWriter stdErr, LogOptions logOptions)
 {
     StdOut = stdOut;
     StdErr = stdErr;
     this.logOptions = logOptions;
 }
Example #12
0
 public ILog CreateLogForTask(ITask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions)
 {
     return new TeamCityLog(stdout);
 }
Example #13
0
 public ILog CreateLogForTask(ITask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions)
 {
     return new TeamCityLog(stdout, logOptions, new TaskLogMessageFormatter(task));
 }