Skip to content

Commit d0abf7f

Browse files
[flutter_tools] don't use verbose when in doctor or help command (flutter#58798)
1 parent 2adf018 commit d0abf7f

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

packages/flutter_tools/lib/executable.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Future<void> main(List<String> args) async {
126126
TemplateRenderer: () => const MustacheTemplateRenderer(),
127127
if (daemon)
128128
Logger: () => NotifyingLogger(verbose: verbose)
129-
else if (verbose)
129+
else if (verbose && !muteCommandLogging)
130130
Logger: () => VerboseLogger(StdoutLogger(
131131
timeoutConfiguration: timeoutConfiguration,
132132
stdio: globals.stdio,

packages/flutter_tools/test/integration.shard/command_output_test.dart

+24-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,30 @@ import 'package:process/process.dart';
99
import '../src/common.dart';
1010

1111
void main() {
12-
test('All development tools are hidden', () async {
13-
final String flutterBin = globals.fs.path.join(getFlutterRoot(), 'bin', 'flutter');
14-
final ProcessResult result = await const LocalProcessManager().run(<String>[
15-
flutterBin,
16-
'-h',
17-
'-v',
18-
]);
12+
test('All development tools are hidden and help text is not verbose', () async {
13+
final String flutterBin = globals.fs.path.join(getFlutterRoot(), 'bin', 'flutter');
14+
final ProcessResult result = await const LocalProcessManager().run(<String>[
15+
flutterBin,
16+
'-h',
17+
'-v',
18+
]);
1919

20-
expect(result.stdout, isNot(contains('ide-config')));
21-
expect(result.stdout, isNot(contains('update-packages')));
22-
expect(result.stdout, isNot(contains('inject-plugins')));
20+
expect(result.stdout, isNot(contains('ide-config')));
21+
expect(result.stdout, isNot(contains('update-packages')));
22+
expect(result.stdout, isNot(contains('inject-plugins')));
23+
// Only printed by verbose tool.
24+
expect(result.stdout, isNot(contains('exiting with code 0')));
25+
});
26+
27+
test('flutter doctor is not verbose', () async {
28+
final String flutterBin = globals.fs.path.join(getFlutterRoot(), 'bin', 'flutter');
29+
final ProcessResult result = await const LocalProcessManager().run(<String>[
30+
flutterBin,
31+
'doctor',
32+
'-v',
33+
]);
34+
35+
// Only printed by verbose tool.
36+
expect(result.stdout, isNot(contains('exiting with code 0')));
2337
});
2438
}

0 commit comments

Comments
 (0)