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

Unified Diff: utils/pub/log.dart

Issue 12095050: Roll back Pub stream changes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Actually roll back changes Created 7 years, 11 months 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 | « utils/pub/io.dart ('k') | utils/pub/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/log.dart
diff --git a/utils/pub/log.dart b/utils/pub/log.dart
index 43499ef21ce6975427ed403543057f380eb3c260..ee1ad1e2990a1240bb50042081f750c3128aceb5 100644
--- a/utils/pub/log.dart
+++ b/utils/pub/log.dart
@@ -6,6 +6,7 @@
library log;
import 'dart:async';
+import 'dart:io';
import 'io.dart';
typedef LogFn(Entry entry);
@@ -153,11 +154,11 @@ void recordTranscript() {
void dumpTranscript() {
if (_transcript == null) return;
- stderrSink.add('---- Log transcript ----\n'.charCodes);
+ stderr.writeString('---- Log transcript ----\n');
for (var entry in _transcript) {
_logToStderrWithLabel(entry);
}
- stderrSink.add('---- End log transcript ----\n'.charCodes);
+ stderr.writeString('---- End log transcript ----\n');
}
/// Sets the verbosity to "normal", which shows errors, warnings, and messages.
@@ -190,38 +191,38 @@ void showAll() {
/// Log function that prints the message to stdout.
void _logToStdout(Entry entry) {
- _logToStream(stdoutSink, entry, showLabel: false);
+ _logToStream(stdout, entry, showLabel: false);
}
/// Log function that prints the message to stdout with the level name.
void _logToStdoutWithLabel(Entry entry) {
- _logToStream(stdoutSink, entry, showLabel: true);
+ _logToStream(stdout, entry, showLabel: true);
}
/// Log function that prints the message to stderr.
void _logToStderr(Entry entry) {
- _logToStream(stderrSink, entry, showLabel: false);
+ _logToStream(stderr, entry, showLabel: false);
}
/// Log function that prints the message to stderr with the level name.
void _logToStderrWithLabel(Entry entry) {
- _logToStream(stderrSink, entry, showLabel: true);
+ _logToStream(stderr, entry, showLabel: true);
}
-void _logToStream(Sink<List<int>> sink, Entry entry, {bool showLabel}) {
+void _logToStream(OutputStream stream, Entry entry, {bool showLabel}) {
bool firstLine = true;
for (var line in entry.lines) {
if (showLabel) {
if (firstLine) {
- sink.add(entry.level.name.charCodes);
- sink.add(': '.charCodes);
+ stream.writeString(entry.level.name);
+ stream.writeString(': ');
} else {
- sink.add(' | '.charCodes);
+ stream.writeString(' | ');
}
}
- sink.add(line.charCodes);
- sink.add('\n'.charCodes);
+ stream.writeString(line);
+ stream.writeString('\n');
firstLine = false;
}
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698