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 * Provides APIs for debugging and error logging. This library introduces | 6 * Provides APIs for debugging and error logging. This library introduces |
7 * abstractions similar to those used in other languages, such as the Closure JS | 7 * abstractions similar to those used in other languages, such as the Closure JS |
8 * Logger and java.util.logging.Logger. | 8 * Logger and java.util.logging.Logger. |
| 9 * |
| 10 * ## Installing ## |
| 11 * |
| 12 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` |
| 13 * file. |
| 14 * |
| 15 * dependencies: |
| 16 * logging: any |
| 17 * |
| 18 * And then run `pub install`. |
| 19 * |
| 20 * [pub]: http://pub.dartlang.org |
9 */ | 21 */ |
10 library logging; | 22 library logging; |
11 | 23 |
12 import 'dart:async'; | 24 import 'dart:async'; |
13 | 25 |
14 /** | 26 /** |
15 * Whether to allow fine-grain logging and configuration of loggers in a | 27 * Whether to allow fine-grain logging and configuration of loggers in a |
16 * hierarchy. When false, all logging is merged in the root logger. | 28 * hierarchy. When false, all logging is merged in the root logger. |
17 */ | 29 */ |
18 bool hierarchicalLoggingEnabled = false; | 30 bool hierarchicalLoggingEnabled = false; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 308 |
297 /** Associated exception message (if any) when recording errors messages. */ | 309 /** Associated exception message (if any) when recording errors messages. */ |
298 String exceptionText; | 310 String exceptionText; |
299 | 311 |
300 LogRecord( | 312 LogRecord( |
301 this.level, this.message, this.loggerName, | 313 this.level, this.message, this.loggerName, |
302 [time, this.exception, this.exceptionText]) : | 314 [time, this.exception, this.exceptionText]) : |
303 this.time = (time == null) ? new DateTime.now() : time, | 315 this.time = (time == null) ? new DateTime.now() : time, |
304 this.sequenceNumber = LogRecord._nextNumber++; | 316 this.sequenceNumber = LogRecord._nextNumber++; |
305 } | 317 } |
OLD | NEW |