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 logging. | 6 * Support for logging. |
7 * | 7 * |
8 * For information on installing and importing this library, see the | 8 * For information on installing and importing this library, see the |
9 * [logging package on pub.dartlang.org] | 9 * [logging package on pub.dartlang.org] |
10 * (http://pub.dartlang.org/packages/logging). | 10 * (http://pub.dartlang.org/packages/logging). |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * log.fine('Got the result: $result'); | 44 * log.fine('Got the result: $result'); |
45 * processResult(result); | 45 * processResult(result); |
46 * }) | 46 * }) |
47 * .catchError((e, stackTrace) => log.severe('Oh noes!', e, stackTrace)); | 47 * .catchError((e, stackTrace) => log.severe('Oh noes!', e, stackTrace)); |
48 * | 48 * |
49 * See the [Logger] class for the different logging methods. | 49 * See the [Logger] class for the different logging methods. |
50 */ | 50 */ |
51 library logging; | 51 library logging; |
52 | 52 |
53 import 'dart:async'; | 53 import 'dart:async'; |
54 import 'package:collection_helpers/wrappers.dart'; | 54 import 'package:collection/wrappers.dart'; |
55 | 55 |
56 /** | 56 /** |
57 * Whether to allow fine-grain logging and configuration of loggers in a | 57 * Whether to allow fine-grain logging and configuration of loggers in a |
58 * hierarchy. When false, all logging is merged in the root logger. | 58 * hierarchy. When false, all logging is merged in the root logger. |
59 */ | 59 */ |
60 bool hierarchicalLoggingEnabled = false; | 60 bool hierarchicalLoggingEnabled = false; |
61 | 61 |
62 /** | 62 /** |
63 * Level for the root-logger. This will be the level of all loggers if | 63 * Level for the root-logger. This will be the level of all loggers if |
64 * [hierarchicalLoggingEnabled] is false. | 64 * [hierarchicalLoggingEnabled] is false. |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 /** Associated stackTrace (if any) when recording errors messages. */ | 350 /** Associated stackTrace (if any) when recording errors messages. */ |
351 final StackTrace stackTrace; | 351 final StackTrace stackTrace; |
352 | 352 |
353 LogRecord(this.level, this.message, this.loggerName, [this.error, | 353 LogRecord(this.level, this.message, this.loggerName, [this.error, |
354 this.stackTrace]) | 354 this.stackTrace]) |
355 : time = new DateTime.now(), | 355 : time = new DateTime.now(), |
356 sequenceNumber = LogRecord._nextNumber++; | 356 sequenceNumber = LogRecord._nextNumber++; |
357 | 357 |
358 String toString() => '[${level.name}] $loggerName: $message'; | 358 String toString() => '[${level.name}] $loggerName: $message'; |
359 } | 359 } |
OLD | NEW |