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

Side by Side Diff: runtime/lib/developer.dart

Issue 1266053003: Make dart:developer log more user friendly (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/lib/developer.cc ('k') | runtime/observatory/tests/service/logging_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch bool debugger({bool when: true, 5 patch bool debugger({bool when: true,
6 String message}) native "Developer_debugger"; 6 String message}) native "Developer_debugger";
7 7
8 patch Object inspect(Object object) native "Developer_inspect"; 8 patch Object inspect(Object object) native "Developer_inspect";
9 9
10 patch log({int sequenceNumber, 10 patch log(String message,
11 int millisecondsSinceEpoch, 11 {DateTime time,
12 int level, 12 int sequenceNumber,
13 String name, 13 int level: 0,
14 String message, 14 String name: '',
15 Zone zone, 15 Zone zone,
16 Object error, 16 Object error,
17 StackTrace stackTrace}) native "Developer_log"; 17 StackTrace stackTrace}) {
18 if (message is! String) {
19 throw new ArgumentError(message, "message", "Must be a String");
20 }
21 if (time == null) {
22 time = new DateTime.now();
23 }
24 if (time is! DateTime) {
25 throw new ArgumentError(time, "time", "Must be a DateTime");
26 }
27 if (sequenceNumber == null) {
28 sequenceNumber = _nextSequenceNumber;
29 } else {
30 _nextSequenceNumber = sequenceNumber + 1;
31 }
32 return _log(message,
33 time.millisecondsSinceEpoch,
34 sequenceNumber,
35 level,
36 name,
37 zone,
38 error,
39 stackTrace);
40 }
41
42 int _nextSequenceNumber = 0;
43
44 _log(String message,
45 int timestamp,
46 int sequenceNumber,
47 int level,
48 String name,
49 Zone zone,
50 Object error,
51 StackTrace stackTrace) native "Developer_log";
OLDNEW
« no previous file with comments | « runtime/lib/developer.cc ('k') | runtime/observatory/tests/service/logging_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698