Commit d8d87f18 authored by Ian Fischer's avatar Ian Fischer

Add very-verbose flag and automatically log some more process-related things...

Add very-verbose flag and automatically log some more process-related things in verbose and very-verbose modes.
parent b72d67a8
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment