Add logger indent option and indent nested xcode command outputs (#7867)

* Add indent option to logger and indent non-flutter nested output

* Add a missed override

* Formatting
diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart
index b43189e..cefa000 100644
--- a/packages/flutter_tools/lib/src/base/logger.dart
+++ b/packages/flutter_tools/lib/src/base/logger.dart
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 import 'dart:async';
-import 'dart:convert' show ASCII;
+import 'dart:convert' show ASCII, LineSplitter;
 
 import 'package:stack_trace/stack_trace.dart';
 
@@ -29,7 +29,10 @@
 
   /// 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, String ansiAlternative });
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  );
 
   /// 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.
@@ -66,13 +69,18 @@
   }
 
   @override
-  void printStatus(String message, { bool emphasis: false, bool newline: true, String ansiAlternative }) {
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  ) {
     _status?.cancel();
     _status = null;
     if (terminal.supportsColor && ansiAlternative != null)
       message = ansiAlternative;
     if (emphasis)
       message = terminal.bolden(message);
+    if (indent != null && indent > 0)
+      message = LineSplitter.split(message).map((String line) => ' ' * indent + line).join('\n');
     if (newline)
       message = '$message\n';
     stdout.write(message);
@@ -114,7 +122,10 @@
   void printError(String message, [StackTrace stackTrace]) => _error.writeln(message);
 
   @override
-  void printStatus(String message, { bool emphasis: false, bool newline: true, String ansiAlternative }) {
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  ) {
     if (newline)
       _status.writeln(message);
     else
@@ -147,7 +158,10 @@
   }
 
   @override
-  void printStatus(String message, { bool emphasis: false, bool newline: true, String ansiAlternative }) {
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  ) {
     _emit(_LogType.status, message);
   }
 
diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart
index d822d18..8e1111d 100644
--- a/packages/flutter_tools/lib/src/commands/daemon.dart
+++ b/packages/flutter_tools/lib/src/commands/daemon.dart
@@ -680,7 +680,10 @@
   }
 
   @override
-  void printStatus(String message, { bool emphasis: false, bool newline: true, String ansiAlternative }) {
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  ) {
     _messageController.add(new LogMessage('status', message));
   }
 
@@ -762,7 +765,10 @@
   }
 
   @override
-  void printStatus(String message, { bool emphasis: false, bool newline: true, String ansiAlternative }) {
+  void printStatus(
+    String message,
+    { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }
+  ) {
     if (logToStdout) {
       print(message);
     } else {
diff --git a/packages/flutter_tools/lib/src/globals.dart b/packages/flutter_tools/lib/src/globals.dart
index 1ca818b..f177ebb 100644
--- a/packages/flutter_tools/lib/src/globals.dart
+++ b/packages/flutter_tools/lib/src/globals.dart
@@ -26,8 +26,19 @@
 ///
 /// 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);
+///
+/// If `indent` is provided, each line of the message will be prepended by the specified number of
+/// whitespaces.
+void printStatus(
+  String message,
+  { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }) {
+  logger.printStatus(
+    message,
+    emphasis: emphasis,
+    newline: newline,
+    ansiAlternative: ansiAlternative,
+    indent: indent
+  );
 }
 
 /// Use this for verbose tracing output. Users can turn this output on in order
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 2129afb..f2a85ac 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -166,10 +166,15 @@
   );
 
   if (result.exitCode != 0) {
-    if (result.stderr.isNotEmpty)
-      printStatus(result.stderr);
-    if (result.stdout.isNotEmpty)
-      printStatus(result.stdout);
+    printStatus('Failed to build iOS app');
+    if (result.stderr.isNotEmpty) {
+      printStatus('Error output from Xcode build:\n↳');
+      printStatus(result.stderr, indent: 4);
+    }
+    if (result.stdout.isNotEmpty) {
+      printStatus('Xcode\'s output:\n↳');
+      printStatus(result.stdout, indent: 4);
+    }
     return new XcodeBuildResult(
       success: false,
       stdout: result.stdout,