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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 1241683005: Support piping log data over the service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « runtime/lib/developer.dart ('k') | runtime/observatory/tests/service/logging_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index fa73cf6266a6b429e6185147b7eab837fa8af9ef..32d5e42baed6436b5a1fa68a116ff3659cba757c 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -954,6 +954,7 @@ class HeapSnapshot {
/// State for a running isolate.
class Isolate extends ServiceObjectOwner with Coverage {
+ static const kLoggingStream = '_Logging';
@reflectable VM get vm => owner;
@reflectable Isolate get isolate => this;
@observable int number;
@@ -1591,6 +1592,15 @@ class DartError extends ServiceObject {
String toString() => 'DartError($message)';
}
+Level _findLogLevel(int value) {
+ for (var level in Level.LEVELS) {
+ if (level.value == value) {
+ return level;
+ }
+ }
+ return new Level('$value', value);
+}
+
/// A [ServiceEvent] is an asynchronous event notification from the vm.
class ServiceEvent extends ServiceObject {
/// The possible 'kind' values.
@@ -1611,6 +1621,7 @@ class ServiceEvent extends ServiceObject {
static const kInspect = 'Inspect';
static const kDebuggerSettingsUpdate = '_DebuggerSettingsUpdate';
static const kConnectionClosed = 'ConnectionClosed';
+ static const kLogging = '_Logging';
ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner);
@@ -1629,6 +1640,7 @@ class ServiceEvent extends ServiceObject {
@observable String reason;
@observable String exceptions;
@observable String bytesAsString;
+ @observable Map logRecord;
int chunkIndex, chunkCount, nodeCount;
@observable bool get isPauseEvent {
@@ -1691,6 +1703,12 @@ class ServiceEvent extends ServiceObject {
var bytes = decodeBase64(map['bytes']);
bytesAsString = UTF8.decode(bytes);
}
+ if (map['logRecord'] != null) {
+ logRecord = map['logRecord'];
+ logRecord['time'] =
+ new DateTime.fromMillisecondsSinceEpoch(logRecord['time']);
+ logRecord['level'] = _findLogLevel(logRecord['level']);
+ }
}
String toString() {
« no previous file with comments | « runtime/lib/developer.dart ('k') | runtime/observatory/tests/service/logging_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698