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 * |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 final DateTime time; | 301 final DateTime time; |
302 | 302 |
303 /** Unique sequence number greater than all log records created before it. */ | 303 /** Unique sequence number greater than all log records created before it. */ |
304 final int sequenceNumber; | 304 final int sequenceNumber; |
305 | 305 |
306 static int _nextNumber = 0; | 306 static int _nextNumber = 0; |
307 | 307 |
308 /** Associated error (if any) when recording errors messages. */ | 308 /** Associated error (if any) when recording errors messages. */ |
309 final Object error; | 309 final Object error; |
310 | 310 |
311 // TODO(kevmoo) - remove before V1 | |
312 /** | |
313 * DEPRECATED. Use [error] instead. | |
314 */ | |
315 @deprecated | |
316 Object get exception => error; | |
317 | |
318 /** Associated stackTrace (if any) when recording errors messages. */ | 311 /** Associated stackTrace (if any) when recording errors messages. */ |
319 final StackTrace stackTrace; | 312 final StackTrace stackTrace; |
320 | 313 |
321 LogRecord(this.level, this.message, this.loggerName, [this.error, | 314 LogRecord(this.level, this.message, this.loggerName, [this.error, |
322 this.stackTrace]) | 315 this.stackTrace]) |
323 : time = new DateTime.now(), | 316 : time = new DateTime.now(), |
324 sequenceNumber = LogRecord._nextNumber++; | 317 sequenceNumber = LogRecord._nextNumber++; |
325 | 318 |
326 String toString() => '[${level.name}] $loggerName: $message'; | 319 String toString() => '[${level.name}] $loggerName: $message'; |
327 } | 320 } |
OLD | NEW |