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
87d0010a
Commit
87d0010a
authored
May 03, 2017
by
xster
Committed by
GitHub
May 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let printError be able to print bold also (#9714)
* Let printError print bold as well * review notes
parent
31000ef7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+1
-1
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-1
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+9
-4
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+3
-3
globals.dart
packages/flutter_tools/lib/src/globals.dart
+5
-1
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
87d0010a
...
...
@@ -160,7 +160,7 @@ class AndroidDevice extends Device {
return
true
;
printError
(
'The ADB at "
${getAdbPath(androidSdk)}
" is too old; please install version 1.0.32 or later.'
);
}
catch
(
error
,
trace
)
{
printError
(
'Error running ADB:
$error
'
,
trace
);
printError
(
'Error running ADB:
$error
'
,
stackTrace:
trace
);
}
return
false
;
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
87d0010a
...
...
@@ -155,7 +155,7 @@ abstract class IOSApp extends ApplicationPackage {
final
Directory
payloadDir
=
fs
.
directory
(
fs
.
path
.
join
(
tempDir
.
path
,
'Payload'
));
bundleDir
=
payloadDir
.
listSync
().
singleWhere
(
_isBundleDirectory
);
}
on
StateError
catch
(
e
,
stackTrace
)
{
printError
(
'Invalid prebuilt iOS binary:
${e.toString()}
'
,
stackTrace
);
printError
(
'Invalid prebuilt iOS binary:
${e.toString()}
'
,
stackTrace
:
stackTrace
);
return
null
;
}
...
...
packages/flutter_tools/lib/src/base/logger.dart
View file @
87d0010a
...
...
@@ -25,7 +25,7 @@ abstract class Logger {
/// Display an error level message to the user. Commands should use this if they
/// fail in some way.
void
printError
(
String
message
,
[
StackTrace
stackTrace
]
);
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
}
);
/// Display normal output of the command. This should be used for things like
/// progress messages, success messages, or just normal command output.
...
...
@@ -60,10 +60,12 @@ class StdoutLogger extends Logger {
bool
get
isVerbose
=>
false
;
@override
void
printError
(
String
message
,
[
StackTrace
stackTrace
]
)
{
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
}
)
{
_status
?.
cancel
();
_status
=
null
;
if
(
emphasis
)
message
=
terminal
.
bolden
(
message
);
stderr
.
writeln
(
message
);
if
(
stackTrace
!=
null
)
stderr
.
writeln
(
stackTrace
.
toString
());
...
...
@@ -144,7 +146,10 @@ class BufferLogger extends Logger {
String
get
traceText
=>
_trace
.
toString
();
@override
void
printError
(
String
message
,
[
StackTrace
stackTrace
])
=>
_error
.
writeln
(
message
);
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
})
{
_error
.
writeln
(
message
);
}
@override
void
printStatus
(
...
...
@@ -185,7 +190,7 @@ class VerboseLogger extends Logger {
bool
get
isVerbose
=>
true
;
@override
void
printError
(
String
message
,
[
StackTrace
stackTrace
]
)
{
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
}
)
{
_emit
(
_LogType
.
error
,
message
,
stackTrace
);
}
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
87d0010a
...
...
@@ -66,7 +66,7 @@ class DaemonCommand extends FlutterCommand {
}
dynamic
_handleError
(
dynamic
error
,
StackTrace
stackTrace
)
{
printError
(
'Error from flutter daemon:
$error
'
,
stackTrace
);
printError
(
'Error from flutter daemon:
$error
'
,
stackTrace
:
stackTrace
);
return
null
;
}
}
...
...
@@ -690,7 +690,7 @@ class NotifyingLogger extends Logger {
Stream
<
LogMessage
>
get
onMessage
=>
_messageController
.
stream
;
@override
void
printError
(
String
message
,
[
StackTrace
stackTrace
]
)
{
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
}
)
{
_messageController
.
add
(
new
LogMessage
(
'error'
,
message
,
stackTrace
));
}
...
...
@@ -757,7 +757,7 @@ class _AppRunLogger extends Logger {
int
_nextProgressId
=
0
;
@override
void
printError
(
String
message
,
[
StackTrace
stackTrace
]
)
{
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
}
)
{
if
(
logToStdout
)
{
stderr
.
writeln
(
message
);
if
(
stackTrace
!=
null
)
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
87d0010a
...
...
@@ -15,7 +15,11 @@ Artifacts get artifacts => Artifacts.instance;
/// Display an error level message to the user. Commands should use this if they
/// fail in some way.
void
printError
(
String
message
,
[
StackTrace
stackTrace
])
=>
logger
.
printError
(
message
,
stackTrace
);
///
/// Set `emphasis` to true to make the output bold if it's supported.
void
printError
(
String
message
,
{
StackTrace
stackTrace
,
bool
emphasis:
false
})
{
logger
.
printError
(
message
,
stackTrace:
stackTrace
,
emphasis:
emphasis
);
}
/// Display normal output of the command. This should be used for things like
/// progress messages, success messages, or just normal command output.
...
...
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