Comments (7)
Oh man, well tools like ag
will change their output format when they detect they are being piped to another process. git
uses the flag --porcelain
to indicate output that is verbose and meant to be parsed by another tool.
I think making --verbose
imply that is fine and I don't recommend those other approaches.
from flutter.
Ah, I just filed #147936 which is a duplicate. We need to check that stdout is a terminal type and disable the pretty printing if its not. It is also ok to allow manually disabling pretty printing to terminal types too.
from flutter.
As an aside, we need to go a bit out our way to fool Xcode since it pretends to be a terminal but can't handle being a terminal quite right. GN does this detection.
from flutter.
https://api.dart.dev/stable/3.3.4/dart-io/Stdout/hasTerminal.html may be what we need (and the one for stderr).
from flutter.
Update: We do some checks for hasTerminal
and supportsAnsiEscapes
, but it sounds like those are either insufficient, or give false-positives.
from flutter.
When I do:
flutter % et build -v | grep supportsAnsiEscapes
supportsAnsiEscapes: false | hasTerminal: false
... it appears detection does work, so I'm assuming we're not guarding something we should be.
from flutter.
The fix is as simple as:
diff --git a/tools/engine_tool/lib/src/logger.dart b/tools/engine_tool/lib/src/logger.dart
index 28bd847885..8b4565d94b 100644
--- a/tools/engine_tool/lib/src/logger.dart
+++ b/tools/engine_tool/lib/src/logger.dart
@@ -169,6 +169,8 @@ class Logger {
/// and emits a carriage return.
void clearLine() {
if (!io.stdout.hasTerminal || _test) {
+ // Just emit a newline in tests or when not connected to a terminal.
+ _ioSinkWrite(io.stdout, '\n');
return;
}
However, it is next to impossible to test because the Logger does a bunch of things with global state.
I'm going to provide a bit more TLC to logger.dart
and then land the fix.
from flutter.
Related Issues (20)
- Range Error (Offset) when building release with latest Beta version HOT 2
- Unable to interact with widgets behind snack bars when `insetPadding` is set in `SnackBarThemeData`. HOT 1
- `flutter update-packages` can fail silently
- `flutter update-packages` does not update version file used by pub
- Remove use of modulemaps in flutter/packages when using SwiftPM HOT 4
- Unable to type in TextField after exiting screen with swipe gesture HOT 6
- Fragment shader doesn't support indexing uniform array with int variable. HOT 2
- repeat drawImage result of toImageSync leading memory leak HOT 3
- Add sample code for 2D chart plotter
- [tool_crash] FileSystemException: Cannot open file, OS Error: The process cannot access the file because the file is occupied by another process., errno = 32 HOT 2
- Support exclusion of flavors when conditonally defining assets
- Deprecate iOS Objective-C create template `flutter create --ios-language objc` HOT 9
- [Impeller] Distorted text in Cupertino dialog HOT 13
- mac-9 lost external connection phone device. HOT 1
- Build fails with <command line>:1:9: error macro name must be an identifier HOT 8
- How Flutter Renders the Frame in Real Time? HOT 1
- Add simpler api for creating a dart:ui Image of a given width and height and by setting individual pixel values HOT 1
- ListView/ListTile: Hover highlight being drawn outside the list boudnaries (on top of other unrelated widgets) HOT 2
- MissingPluginException HOT 1
- [in_app_purchase] [iOS] Host platform returned null value for non-null return value HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.