mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add very-verbose flag and automatically log some more process-related things in verbose and very-verbose modes.
This commit is contained in:
parent
b72d67a8fe
commit
d8d87f1833
@ -32,6 +32,10 @@ void main(List<String> args) {
|
||||
abbr: 'v',
|
||||
negatable: false,
|
||||
help: 'Noisy logging, including all shell commands executed.');
|
||||
parser.addFlag('very-verbose',
|
||||
negatable: false,
|
||||
help: 'Very noisy logging, including the output of all '
|
||||
'shell commands executed.');
|
||||
parser.addSeparator('commands:');
|
||||
|
||||
for (CommandHandler handler in [
|
||||
@ -55,6 +59,10 @@ void main(List<String> args) {
|
||||
Logger.root.level = Level.INFO;
|
||||
}
|
||||
|
||||
if (results['very-verbose']) {
|
||||
Logger.root.level = Level.FINE;
|
||||
}
|
||||
|
||||
if (results['help']) {
|
||||
_printUsage(parser, handlers);
|
||||
} else if (results.command != null) {
|
||||
|
@ -13,10 +13,14 @@ String runCheckedSync(List<String> cmd) {
|
||||
ProcessResult results =
|
||||
Process.runSync(cmd[0], cmd.getRange(1, cmd.length).toList());
|
||||
if (results.exitCode != 0) {
|
||||
if (results.stderr.length > 0) {
|
||||
_logging.info('Errors logged: ' + results.stderr);
|
||||
}
|
||||
throw 'Error code ' +
|
||||
results.exitCode.toString() +
|
||||
' returned when attempting to run command: ' +
|
||||
cmd.join(' ');
|
||||
}
|
||||
_logging.fine(results.stdout.trim());
|
||||
return results.stdout;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user