def update_reporting(self, global_options, is_quiet, run_tracker):
    "Updates reporting config once we've parsed cmd-line flags."
    removed_reporter = run_tracker.report.remove_reporter('capturing')
    buffered_out = self._consume_stringio(removed_reporter.settings.outfile)
    buffered_err = self._consume_stringio(removed_reporter.settings.errfile)
    log_level = Report.log_level_from_string((global_options.level or 'info'))
    color = (global_options.colors and (os.getenv('TERM') != 'dumb'))
    timing = global_options.time
    cache_stats = global_options.time
    if is_quiet:
        console_reporter = QuietReporter(run_tracker, QuietReporter.Settings(log_level=log_level, color=color, timing=timing, cache_stats=cache_stats))
    else:
        settings = PlainTextReporter.Settings(log_level=log_level, outfile=sys.stdout, errfile=sys.stderr, color=color, indent=True, timing=timing, cache_stats=cache_stats, label_format=self.get_options().console_label_format, tool_output_format=self.get_options().console_tool_output_format)
        console_reporter = PlainTextReporter(run_tracker, settings)
        console_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
        console_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
        console_reporter.flush()
    run_tracker.report.add_reporter('console', console_reporter)
    if global_options.logdir:
        safe_mkdir(global_options.logdir)
        run_id = run_tracker.run_info.get_info('id')
        outfile = open(os.path.join(global_options.logdir, '{}.log'.format(run_id)), 'w')
        errfile = open(os.path.join(global_options.logdir, '{}.err.log'.format(run_id)), 'w')
        settings = PlainTextReporter.Settings(log_level=log_level, outfile=outfile, errfile=errfile, color=False, indent=True, timing=True, cache_stats=True, label_format=self.get_options().console_label_format, tool_output_format=self.get_options().console_tool_output_format)
        logfile_reporter = PlainTextReporter(run_tracker, settings)
        logfile_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
        logfile_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
        logfile_reporter.flush()
        run_tracker.report.add_reporter('logfile', logfile_reporter)
    invalidation_report = self._get_invalidation_report()
    if invalidation_report:
        run_id = run_tracker.run_info.get_info('id')
        outfile = os.path.join(self.get_options().reports_dir, run_id, 'invalidation-report.csv')
        invalidation_report.set_filename(outfile)
    return invalidation_report
Updates reporting config once we've parsed cmd-line flags.
def update_reporting(self, global_options, is_quiet, run_tracker):
    
    removed_reporter = run_tracker.report.remove_reporter('capturing')
    buffered_out = self._consume_stringio(removed_reporter.settings.outfile)
    buffered_err = self._consume_stringio(removed_reporter.settings.errfile)
    log_level = Report.log_level_from_string((global_options.level or 'info'))
    color = (global_options.colors and (os.getenv('TERM') != 'dumb'))
    timing = global_options.time
    cache_stats = global_options.time
    if is_quiet:
        console_reporter = QuietReporter(run_tracker, QuietReporter.Settings(log_level=log_level, color=color, timing=timing, cache_stats=cache_stats))
    else:
        settings = PlainTextReporter.Settings(log_level=log_level, outfile=sys.stdout, errfile=sys.stderr, color=color, indent=True, timing=timing, cache_stats=cache_stats, label_format=self.get_options().console_label_format, tool_output_format=self.get_options().console_tool_output_format)
        console_reporter = PlainTextReporter(run_tracker, settings)
        console_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
        console_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
        console_reporter.flush()
    run_tracker.report.add_reporter('console', console_reporter)
    if global_options.logdir:
        safe_mkdir(global_options.logdir)
        run_id = run_tracker.run_info.get_info('id')
        outfile = open(os.path.join(global_options.logdir, '{}.log'.format(run_id)), 'w')
        errfile = open(os.path.join(global_options.logdir, '{}.err.log'.format(run_id)), 'w')
        settings = PlainTextReporter.Settings(log_level=log_level, outfile=outfile, errfile=errfile, color=False, indent=True, timing=True, cache_stats=True, label_format=self.get_options().console_label_format, tool_output_format=self.get_options().console_tool_output_format)
        logfile_reporter = PlainTextReporter(run_tracker, settings)
        logfile_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
        logfile_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
        logfile_reporter.flush()
        run_tracker.report.add_reporter('logfile', logfile_reporter)
    invalidation_report = self._get_invalidation_report()
    if invalidation_report:
        run_id = run_tracker.run_info.get_info('id')
        outfile = os.path.join(self.get_options().reports_dir, run_id, 'invalidation-report.csv')
        invalidation_report.set_filename(outfile)
    return invalidation_report