You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
}
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
The text was updated successfully, but these errors were encountered: