Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
04e7446b
Commit
04e7446b
authored
Nov 07, 2016
by
Ian Hickson
Committed by
GitHub
Nov 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the fire red on black-and-white terminals (#6748)
parent
974da474
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
17 deletions
+34
-17
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+14
-12
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+2
-2
globals.dart
packages/flutter_tools/lib/src/globals.dart
+9
-2
hot.dart
packages/flutter_tools/lib/src/hot.dart
+9
-1
No files found.
packages/flutter_tools/lib/src/base/logger.dart
View file @
04e7446b
...
...
@@ -26,7 +26,7 @@ abstract class Logger {
/// Display normal output of the command. This should be used for things like
/// progress messages, success messages, or just normal command output.
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
});
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
});
/// Use this for verbose tracing output. Users can turn this output on in order
/// to help diagnose issues with the toolchain or with their setup.
...
...
@@ -60,14 +60,16 @@ class StdoutLogger extends Logger {
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
_status
?.
cancel
();
_status
=
null
;
if
(
terminal
.
supportsColor
&&
ansiAlternative
!=
null
)
message
=
ansiAlternative
;
if
(
emphasis
)
message
=
terminal
.
bolden
(
message
);
if
(
newline
)
stdout
.
writeln
(
emphasis
?
terminal
.
writeBold
(
message
)
:
message
);
else
stdout
.
write
(
emphasis
?
terminal
.
writeBold
(
message
)
:
message
);
message
=
'
$message
\n
'
;
stdout
.
write
(
message
);
}
@override
...
...
@@ -106,7 +108,7 @@ class BufferLogger extends Logger {
void
printError
(
String
message
,
[
StackTrace
stackTrace
])
=>
_error
.
writeln
(
message
);
@override
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
if
(
newline
)
_status
.
writeln
(
message
);
else
...
...
@@ -139,7 +141,7 @@ class VerboseLogger extends Logger {
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
_emit
(
_LogType
.
status
,
message
);
}
...
...
@@ -168,7 +170,7 @@ class VerboseLogger extends Logger {
}
else
{
prefix
=
'+
$millis
ms'
.
padLeft
(
prefixWidth
);
if
(
millis
>=
100
)
prefix
=
terminal
.
writeBold
(
prefix
);
prefix
=
terminal
.
bolden
(
prefix
);
}
prefix
=
'[
$prefix
] '
;
...
...
@@ -176,11 +178,11 @@ class VerboseLogger extends Logger {
String
indentMessage
=
message
.
replaceAll
(
'
\n
'
,
'
\n
$indent
'
);
if
(
type
==
_LogType
.
error
)
{
stderr
.
writeln
(
prefix
+
terminal
.
writeBold
(
indentMessage
));
stderr
.
writeln
(
prefix
+
terminal
.
bolden
(
indentMessage
));
if
(
stackTrace
!=
null
)
stderr
.
writeln
(
indent
+
stackTrace
.
toString
().
replaceAll
(
'
\n
'
,
'
\n
$indent
'
));
}
else
if
(
type
==
_LogType
.
status
)
{
print
(
prefix
+
terminal
.
writeBold
(
indentMessage
));
print
(
prefix
+
terminal
.
bolden
(
indentMessage
));
}
else
{
print
(
prefix
+
indentMessage
);
}
...
...
@@ -210,7 +212,7 @@ class AnsiTerminal {
bool
supportsColor
;
String
writeBold
(
String
str
)
=>
supportsColor
?
'
$_bold$str$_reset
'
:
str
;
String
bolden
(
String
str
)
=>
supportsColor
?
'
$_bold$str$_reset
'
:
str
;
String
clearScreen
()
=>
supportsColor
?
_clear
:
'
\n\n
'
;
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
04e7446b
...
...
@@ -624,7 +624,7 @@ class NotifyingLogger extends Logger {
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
_messageController
.
add
(
new
LogMessage
(
'status'
,
message
));
}
...
...
@@ -698,7 +698,7 @@ class _AppRunLogger extends Logger {
}
@override
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
_sendLogEvent
(<
String
,
dynamic
>{
'log'
:
message
});
}
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
04e7446b
...
...
@@ -27,8 +27,15 @@ void printError(String message, [StackTrace stackTrace]) => logger.printError(me
/// Display normal output of the command. This should be used for things like
/// progress messages, success messages, or just normal command output.
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
})
{
logger
.
printStatus
(
message
,
emphasis:
emphasis
,
newline:
newline
);
///
/// Set `emphasis` to true to make the output bold if it's supported.
///
/// Set `newline` to false to skip the trailing linefeed.
///
/// If `ansiAlternative` is provided, and the terminal supports color, that
/// string will be printed instead of the message.
void
printStatus
(
String
message
,
{
bool
emphasis:
false
,
bool
newline:
true
,
String
ansiAlternative
})
{
logger
.
printStatus
(
message
,
emphasis:
emphasis
,
newline:
newline
,
ansiAlternative:
ansiAlternative
);
}
/// Use this for verbose tracing output. Users can turn this output on in order
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
04e7446b
...
...
@@ -594,7 +594,15 @@ class HotRunner extends ResidentRunner {
@override
void
printHelp
({
@required
bool
details
})
{
printStatus
(
'🔥 To hot reload your app on the fly, press "r" or F5. To restart the app entirely, press "R".'
,
emphasis:
true
);
const
String
fire
=
'🔥'
;
const
String
redOnBlack
=
'
\
u001B[31;40m'
;
const
String
bold
=
'
\
u001B[0;1m'
;
const
String
reset
=
'
\
u001B[0m'
;
printStatus
(
'
$fire
To hot reload your app on the fly, press "r" or F5. To restart the app entirely, press "R".'
,
ansiAlternative:
'
$redOnBlack$fire$bold
To
${redOnBlack}
hot reload
$bold
your app on the fly, '
'press "r" or F5. To restart the app entirely, press "R".
$reset
'
);
printStatus
(
'The Observatory debugger and profiler is available at: http://127.0.0.1:
$_observatoryPort
/'
);
if
(
details
)
{
printStatus
(
'To dump the widget hierarchy of the app (debugDumpApp), press "w".'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment