OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Support for debugging and error logging. | 6 * Support for debugging and error logging. |
7 * | 7 * |
8 * This library introduces abstractions similar to those used in other | 8 * This library introduces abstractions similar to those used in other |
9 * languages, such as the Closure JS Logger and java.util.logging.Logger. | 9 * languages, such as the Closure JS Logger and java.util.logging.Logger. |
10 * | 10 * |
11 * For information on installing and importing this library, see the | 11 * For information on installing and importing this library, see the |
12 * [logging package on pub.dartlang.org] | 12 * [logging package on pub.dartlang.org] |
13 * (http://pub.dartlang.org/packages/logging). | 13 * (http://pub.dartlang.org/packages/logging). |
14 */ | 14 */ |
15 library logging; | 15 library logging; |
16 | 16 |
17 import 'dart:async'; | 17 import 'dart:async'; |
18 import 'package:meta/meta.dart'; | |
19 import 'package:unmodifiable_collection/unmodifiable_collection.dart'; | 18 import 'package:unmodifiable_collection/unmodifiable_collection.dart'; |
20 | 19 |
21 /** | 20 /** |
22 * Whether to allow fine-grain logging and configuration of loggers in a | 21 * Whether to allow fine-grain logging and configuration of loggers in a |
23 * hierarchy. When false, all logging is merged in the root logger. | 22 * hierarchy. When false, all logging is merged in the root logger. |
24 */ | 23 */ |
25 bool hierarchicalLoggingEnabled = false; | 24 bool hierarchicalLoggingEnabled = false; |
26 | 25 |
27 /** | 26 /** |
28 * Level for the root-logger. This will be the level of all loggers if | 27 * Level for the root-logger. This will be the level of all loggers if |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 /** Associated stackTrace (if any) when recording errors messages. */ | 318 /** Associated stackTrace (if any) when recording errors messages. */ |
320 final StackTrace stackTrace; | 319 final StackTrace stackTrace; |
321 | 320 |
322 LogRecord(this.level, this.message, this.loggerName, [this.error, | 321 LogRecord(this.level, this.message, this.loggerName, [this.error, |
323 this.stackTrace]) | 322 this.stackTrace]) |
324 : time = new DateTime.now(), | 323 : time = new DateTime.now(), |
325 sequenceNumber = LogRecord._nextNumber++; | 324 sequenceNumber = LogRecord._nextNumber++; |
326 | 325 |
327 String toString() => '[${level.name}] $loggerName: $message'; | 326 String toString() => '[${level.name}] $loggerName: $message'; |
328 } | 327 } |
OLD | NEW |