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
a6635489
Commit
a6635489
authored
Sep 29, 2015
by
Ian Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add optional prefix to runCommandAndStreamOutput for logs commands.
parent
5e118891
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
device.dart
packages/flutter_tools/lib/src/device.dart
+1
-1
process.dart
packages/flutter_tools/lib/src/process.dart
+4
-3
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
a6635489
...
...
@@ -334,7 +334,7 @@ class AndroidDevice extends _Device {
'-s'
,
'sky'
,
'chromium'
,
]);
]
,
prefix:
'ANDROID: '
);
}
@override
...
...
packages/flutter_tools/lib/src/process.dart
View file @
a6635489
...
...
@@ -14,15 +14,16 @@ final Logger _logging = new Logger('sky_tools.process');
/// This runs the command and streams stdout/stderr from the child process to
/// this process' stdout/stderr.
Future
<
int
>
runCommandAndStreamOutput
(
List
<
String
>
cmd
)
async
{
Future
<
int
>
runCommandAndStreamOutput
(
List
<
String
>
cmd
,
{
String
prefix:
''
})
async
{
_logging
.
info
(
cmd
.
join
(
' '
));
Process
proc
=
await
Process
.
start
(
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
());
proc
.
stdout
.
transform
(
UTF8
.
decoder
).
listen
((
data
)
{
stdout
.
write
(
data
);
stdout
.
write
(
'
$prefix${data.trimRight().split('\n').join('\n$prefix')}
\n
'
);
});
proc
.
stderr
.
transform
(
UTF8
.
decoder
).
listen
((
data
)
{
stderr
.
write
(
data
);
stderr
.
write
(
'
$prefix${data.trimRight().split('\n').join('\n$prefix')}
\n
'
);
});
return
proc
.
exitCode
;
}
...
...
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