@@ -6,28 +6,33 @@ import 'package:path/path.dart' as p;
6
6
import 'package:source_span/source_span.dart' ;
7
7
import 'package:stack_trace/stack_trace.dart' ;
8
8
9
+ import '../deprecation.dart' ;
9
10
import '../io.dart' ;
10
11
import '../logger.dart' ;
11
12
import '../utils.dart' ;
12
13
13
14
/// A logger that prints warnings to standard error or browser console.
14
- final class StderrLogger implements Logger {
15
+ final class StderrLogger extends LoggerWithDeprecationType {
15
16
/// Whether to use terminal colors in messages.
16
17
final bool color;
17
18
18
19
const StderrLogger ({this .color = false });
19
20
20
- void warn (String message,
21
- {FileSpan ? span, Trace ? trace, bool deprecation = false }) {
21
+ void internalWarn (String message,
22
+ {FileSpan ? span, Trace ? trace, Deprecation ? deprecation}) {
22
23
var result = StringBuffer ();
23
24
if (color) {
24
25
// Bold yellow.
25
26
result.write ('\u 001b[33m\u 001b[1m' );
26
- if (deprecation) result.write ('Deprecation ' );
27
+ if (deprecation != null ) result.write ('Deprecation ' );
27
28
result.write ('Warning\u 001b[0m' );
29
+ if (deprecation != null ) {
30
+ result.write (' [\u 001b[34m$deprecation \u 001b[0m]' );
31
+ }
28
32
} else {
29
- if (deprecation) result.write ('DEPRECATION ' );
33
+ if (deprecation != null ) result.write ('DEPRECATION ' );
30
34
result.write ('WARNING' );
35
+ if (deprecation != null ) result.write (' [$deprecation ]' );
31
36
}
32
37
33
38
if (span == null ) {
0 commit comments