Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: pkg/analysis_server/lib/driver.dart

Issue 751353002: An option to enable 'print' to send output to the console. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/driver.dart
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
index 4c0259c25039210c53753564297317eef8a151bf..74f1dcd8b0e7cbc915b9f459b2219dee79d0044e 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/driver.dart
@@ -51,6 +51,13 @@ class Driver {
"instrumentation-log-file";
/**
+ * The name of the option used to specify if [print] should print to the
+ * console instead of being intercepted.
+ */
+ static const String INTERNAL_PRINT_TO_CONSOLE =
+ "internal-print-to-console";
+
+ /**
* The name of the option used to specify the port to which the server will
* connect.
*/
@@ -98,6 +105,11 @@ class Driver {
parser.addOption(
INSTRUMENTATION_LOG_FILE_OPTION,
help: "[path] the file to which instrumentation data will be logged");
+ parser.addFlag(
+ INTERNAL_PRINT_TO_CONSOLE,
+ help: "enable sending `print` output to the console",
+ defaultsTo: false,
+ negatable: false);
parser.addOption(
PORT_OPTION,
help: "[port] the port on which the server will listen");
@@ -159,14 +171,24 @@ class Driver {
if (serve_http) {
httpServer.serveHttp(port);
}
- _capturePrints(() {
+
+ if (results[INTERNAL_PRINT_TO_CONSOLE]) {
stdioServer.serveStdio().then((_) {
if (serve_http) {
httpServer.close();
}
exit(0);
});
- }, httpServer.recordPrint);
+ } else {
+ _capturePrints(() {
+ stdioServer.serveStdio().then((_) {
+ if (serve_http) {
+ httpServer.close();
+ }
+ exit(0);
+ });
+ }, httpServer.recordPrint);
+ }
}
/**
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698