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

Unified Diff: sdk/lib/developer/developer.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 | « sdk/lib/_internal/js_runtime/lib/developer_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/developer/developer.dart
diff --git a/sdk/lib/developer/developer.dart b/sdk/lib/developer/developer.dart
index 03c75c1fbb0c39eecdb3717ecdebb4f0bf94c035..04a3b0053516c8682c14e301ba517965451e970c 100644
--- a/sdk/lib/developer/developer.dart
+++ b/sdk/lib/developer/developer.dart
@@ -11,16 +11,17 @@
///
library dart.developer;
+import 'dart:async';
import 'dart:convert';
part 'profiler.dart';
/// If [when] is true, stop the program as if a breakpoint were hit at the
/// following statement.
-///
+///
/// Returns the value of [when]. Some debuggers may
/// display [msg].
-///
+///
/// NOTE: When invoked, the isolate will not return until a debugger
/// continues execution. When running in the Dart VM the behaviour is the same
/// regardless of whether or not a debugger is connected. When compiled to
@@ -29,6 +30,36 @@ part 'profiler.dart';
external bool debugger({bool when: true, String msg});
/// Send a reference to [object] to any attached debuggers.
-///
+///
/// Debuggers may open an inspector on the object. Returns the argument.
external inspect(object);
+
+/// Emit a log event.
+/// [sequenceNumber] is a monotonically increasing sequence number.
+/// [millisececondsSinceEpoch] is a timestamp.
+/// [level] is the severity level (value between 0 and 2000 inclusive).
+/// [name] is the name of the source of the log message.
+/// [message] is the log message.
+/// [zone] (optional) the zone where the log was emitted
+/// [error] (optional) an error object associated with this log event.
+/// [stackTrace] (optional) a stack trace associated with this log event.
+external log(int sequenceNumber,
+ int millisecondsSinceEpoch,
+ int level,
+ String name,
+ String message,
+ [Zone zone,
+ Object error,
+ StackTrace stackTrace]);
+
+/// Emit a log event for a a [LogRecord] from the [logging] package.
+void logOnRecord(dynamic logRecord) {
+ log(logRecord.sequenceNumber,
+ logRecord.time.millisecondsSinceEpoch,
+ logRecord.level.value,
+ logRecord.loggerName,
+ logRecord.message,
+ null,
+ logRecord.error,
+ logRecord.stackTrace);
+}
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/developer_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698