Skip to content

Commit fce3759

Browse files
authored
[PE] migrate printStackTrace to proper logging (#8116)
Inspection description: > Reports calls to Throwable.printStackTrace() without arguments. Such statements are often used for temporary debugging and should be either removed from the production code or replaced with a more robust logging facility. Note that this PR disables the inspection in TEST scopes since `printStackTrace()` is handy there and "robust" logging in a test context is often more of a hinderance than help. --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 2c97504 commit fce3759

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.idea/inspectionProfiles/Project_Default.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter-idea/src/io/flutter/logging/FlutterConsoleLogManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public void flushFlutterErrorQueue() {
163163
}
164164
}
165165
catch (InterruptedException e) {
166-
e.printStackTrace();
166+
LOG.error(e);
167167
}
168168
}
169169
}

0 commit comments

Comments
 (0)