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() { |