예제 #1
0
파일: Bounce.cs 프로젝트: jdomzhang/bounce
 public Bounce()
 {
     LogFactory = new TaskLogFactory();
     LogOptions = new LogOptions {CommandOutput = false, LogLevel = LogLevel.Warning, ReportTargetEnd = true};
     ShellCommand = new ShellCommandExecutor(() => Log);
     TargetInvoker = new TargetInvoker(this);
 }
예제 #2
0
 public TeamCityLog(TextWriter output, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
     : base(output, output, logOptions, logMessageFormatter)
 {
     this.Output = output;
     LogOptions = logOptions;
     TeamCityFormatter = new TeamCityFormatter();
 }
예제 #3
0
파일: Bounce.cs 프로젝트: haos11/bounce
 public Bounce(LogOptions logOptions)
 {
     LogFactory = new TaskLogFactory();
     LogOptions = logOptions;
     ShellCommand = new ShellCommandExecutor(() => Log);
     TargetInvoker = new TargetInvoker(this);
 }
예제 #4
0
파일: Log.cs 프로젝트: joshski/bounce
 public Log(TextWriter stdout, TextWriter stderr, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
 {
     Stdout = stdout;
     Stderr = stderr;
     LogOptions = logOptions;
     LogMessageFormatter = logMessageFormatter;
 }
예제 #5
0
 public Log(TextWriter stdout, TextWriter stderr, LogOptions logOptions, ILogMessageFormatter logMessageFormatter)
 {
     Stdout              = stdout;
     Stderr              = stderr;
     LogOptions          = logOptions;
     LogMessageFormatter = logMessageFormatter;
 }
예제 #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);
     }
 }
예제 #7
0
        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;
        }
예제 #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);
        }
예제 #9
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;
            }
        }
예제 #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;
            }
        }
예제 #11
0
파일: TaskLog.cs 프로젝트: haos11/bounce
 public TaskLog(TextWriter stdOut, TextWriter stdErr, LogOptions logOptions)
 {
     StdOut = stdOut;
     StdErr = stdErr;
     this.logOptions = logOptions;
 }
예제 #12
0
 public ILog CreateLogForTask(ITask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions)
 {
     return new TeamCityLog(stdout);
 }
예제 #13
0
 public ILog CreateLogForTask(ITask task, TextWriter stdout, TextWriter stderr, LogOptions logOptions)
 {
     return new TeamCityLog(stdout, logOptions, new TaskLogMessageFormatter(task));
 }