Pretty print warnings and errors.

        :param bool warnings: if ``True``, also print warnings.
        :rtype: string
432133
def pretty_print(self, warnings=False):
        
        msg = []
        if (warnings) and (len(self.warnings) > 0):
            msg.append(u"Warnings:")
            for warning in self.warnings:
                msg.append(u"  %s" % warning)
        if len(self.errors) > 0:
            msg.append(u"Errors:")
            for error in self.errors:
                msg.append(u"  %s" % error)
        return u"\n".join(msg)
1193618
def print_err(self, *lst):
      
      self.print2file(self.stderr, False, True, *lst)
881541
def echo_warnings_via_pager(warnings: List[WarningTuple], sep: str = '\t') -> None:
    """"""
    # Exit if no warnings
    if not warnings:
        click.echo('Congratulations! No warnings.')
        sys.exit(0)

    max_line_width = max(
        len(str(exc.line_number))
        for _, exc, _ in warnings
    )

    max_warning_width = max(
        len(exc.__class__.__name__)
        for _, exc, _ in warnings
    )

    s1 = '{:>' + str(max_line_width) + '}' + sep
    s2 = '{:>' + str(max_warning_width) + '}' + sep

    def _make_line(path: str, exc: BELParserWarning):
        s = click.style(path, fg='cyan') + sep
        s += click.style(s1.format(exc.line_number), fg='blue', bold=True)
        s += click.style(s2.format(exc.__class__.__name__),
                         fg=('red' if exc.__class__.__name__.endswith('Error') else 'yellow'))
        s += click.style(exc.line, bold=True) + sep
        s += click.style(str(exc))
        return s

    click.echo_via_pager('\n'.join(
        _make_line(path, exc)
        for path, exc, _ in warnings
    ))
445218
def error(message, code='ERROR'):
    
    now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    output = now + ' [' + torn.plugins.colors.FAIL + \
            code + torn.plugins.colors.ENDC + '] \t' + \
            message
    print(output)
942588
function printWarnings (deps, type) {
  if (!Object.keys(deps).length) return

  var warnings = {
    E404: {title: 'Unregistered', list: []},
    ESCM: {title: 'SCM', list: []},
    EDEPTYPE: {title: 'Non-string dependency', list: []}
  }

  for (var name in deps) {
    var dep = deps[name]

    if (dep.warn) {
      warnings[dep.warn.code].list.push([clc.magenta(name), clc.red(dep.warn.toString())])
    }
  }

  Object.keys(warnings).forEach(function (warnType) {
    var warnList = warnings[warnType].list

    if (!warnList.length) return

    var table = new Table({head: ['Name', 'Message'], style: {head: ['reset']}})

    console.log(clc.underline(warnings[warnType].title + ' ' + (type ? type + 'D' : 'd') + 'ependencies') + '\n')
    warnList.forEach(function (row) { table.push(row) })
    console.log(table.toString() + '\n')
  })
}
91649
def show_error(msg):
    
    sys.stdout.flush()
    sys.stderr.write("\n{0!s}: {1}".format(colored.red("Error"), msg + '\n'))
918344
def msg(cls, error=None, debug=True, trace=True):
        
        if debug and error is not None:
            print(error)
        # TODO: BUG: trace should only be printed if debug is true
        if trace:
            print(traceback.format_exc())
65170
def warning(self, *msg):
        
        label = colors.yellow("WARNING")
        self._msg(label, *msg)
411106
protected void printError(final Span references[], final Span predictions[],
      final T referenceSample, final T predictedSample, final String sentence) {
    final List<Span> falseNegatives = new ArrayList<Span>();
    final List<Span> falsePositives = new ArrayList<Span>();

    findErrors(references, predictions, falseNegatives, falsePositives);

    if (falsePositives.size() + falseNegatives.size() > 0) {

      printSamples(referenceSample, predictedSample);

      printErrors(falsePositives, falseNegatives, sentence);

    }
  }
790112
def msg_warn(message):
    
    to_stdout(" (!) {message}".format(message=message),
              colorf=yellow, bold=True)
    if _logger:
        _logger.warn(message)
161557
def warn(msg, level=0, prefix=True):
    
    if will_print(level):
        printer(("WARNING: " if prefix else "") + msg, "yellow")
24050
private static boolean summarize( List<String> warnings, List<String> errors, boolean isNoWarn )
  {
    if( isNoWarn )
    {
      System.out.printf( "\ngosuc completed with %d errors. Warnings were disabled.\n", errors.size() );
    }
    else
    {
      System.out.printf( "\ngosuc completed with %d warnings and %d errors.\n", warnings.size(), errors.size() );
    }

    return errors.size() > 0;
  }
1268783
def cprint(message, status=None):
    
    # TODO use less obscure dict, probably "error", "warn", "success" as keys
    status = {'warn': Fore.YELLOW, 'err': Fore.RED,
              'ok': Fore.GREEN, None: Style.BRIGHT}[status]
    print(status + message + Style.RESET_ALL)
791434
def show_warnings(self):
        """"""
        if self._server_version < (4,1): return ()
        self.query("SHOW WARNINGS")
        r = self.store_result()
        warnings = r.fetch_row(0)
        return warnings
816760
public void printWarning() {
    System.out.print("Warning: ");
    System.out.print(description);
    if (value != null)
      System.out.print(" (" + value + ")");
    System.out.println();
  }
1001960
def fail_print(error):
    
    print(COLORS.fail, error.message, COLORS.end)
    print(COLORS.fail, error.errors, COLORS.end)
404529
def print_err(*args, **kwargs):
    
    sys.stderr.write(" ".join(str(arg) for arg in args) + "\n")
    if kwargs.get("flush", False):
        sys.stderr.flush()