Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: tools/migration/lib/src/log.dart

Issue 2987533002: Add simple test migration helper. (Closed)
Patch Set: Merge branch 'master' into migration-tool Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/migration/bin/migrate_batch.dart ('k') | tools/migration/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6
7 final _cyan = _getSpecial('\u001b[36m');
8 final _green = _getSpecial('\u001b[32m');
9 final _magenta = _getSpecial('\u001b[35m');
10 final _red = _getSpecial('\u001b[31m');
11 final _yellow = _getSpecial('\u001b[33m');
12 final _blue = _getSpecial('\u001b[34m');
13 final _gray = _getSpecial('\u001b[1;30m');
14 final _none = _getSpecial('\u001b[0m');
15 final _noColor = _getSpecial('\u001b[39m');
16 final _bold = _getSpecial('\u001b[1m');
17
18 void done(Object message) {
19 print(" ${green('(DONE)')} $message");
20 }
21
22 void note(Object message) {
23 print(" ${cyan('(NOTE)')} $message");
24 }
25
26 void todo(Object message) {
27 print("${red('(TODO)')} $message");
28 }
29
30 String bold(text) => "$_bold$text$_none";
31
32 String cyan(text) => "$_cyan$text$_noColor";
33
34 String green(text) => "$_green$text$_noColor";
35
36 String red(text) => "$_red$text$_noColor";
37
38 /// Gets a "special" string (ANSI escape or Unicode).
39 ///
40 /// On Windows or when not printing to a terminal, returns something else since
41 /// those aren't supported.
42 String _getSpecial(String special, [String onWindows = '']) {
43 if (Platform.operatingSystem == 'windows' ||
44 stdioType(stdout) != StdioType.TERMINAL) {
45 return onWindows;
46 }
47
48 return special;
49 }
OLDNEW
« no previous file with comments | « tools/migration/bin/migrate_batch.dart ('k') | tools/migration/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698