Skip to content

use span.getLocationMessage in errors logged by pub #15604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sigmundch opened this issue Dec 12, 2013 · 5 comments
Closed

use span.getLocationMessage in errors logged by pub #15604

sigmundch opened this issue Dec 12, 2013 · 5 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@sigmundch
Copy link
Member

Span has support for highlighting errors, since TransformLogger already takes this information, we should use it when printing error messages in the console.

For example, here is how the polymer-linter would normally print to the console:

 var useColors = stdioType(stdout) == StdioType.TERMINAL;
  var levelColor = (kind == 'error') ? _RED_COLOR : _MAGENTA_COLOR;
  var output = new StringBuffer();
  if (useColors) output.write(levelColor);
  output..write(kind)..write(' ');
  if (useColors) output.write(_NO_COLOR);
  if (span == null) {
    output.write(message);
  } else {
    output.write(span.getLocationMessage(message,
          useColors: useColors,
          color: levelColor));
  }
  return output.toString();
}

More details here:
https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/pkg/polymer/lib/src/build/linter.dart?r=31021#­190

@munificent
Copy link
Member

Removed Type-Defect label.
Added Type-Enhancement label.

@munificent
Copy link
Member

Removed Priority-Unassigned label.
Added Priority-Medium label.

@munificent
Copy link
Member

Marked this as blocking #15829.

@munificent
Copy link
Member

We've been doing this for a while, as far as I know.


Added Fixed label.

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#773.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants