| 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 */ | 9 */ |
| 10 library logging; | 10 library logging; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 * individual [Handler]s. | 306 * individual [Handler]s. |
| 307 */ | 307 */ |
| 308 class LogRecord { | 308 class LogRecord { |
| 309 final Level level; | 309 final Level level; |
| 310 final String message; | 310 final String message; |
| 311 | 311 |
| 312 /** Logger where this record is stored. */ | 312 /** Logger where this record is stored. */ |
| 313 final String loggerName; | 313 final String loggerName; |
| 314 | 314 |
| 315 /** Time when this record was created. */ | 315 /** Time when this record was created. */ |
| 316 final Date time; | 316 final DateTime time; |
| 317 | 317 |
| 318 /** Unique sequence number greater than all log records created before it. */ | 318 /** Unique sequence number greater than all log records created before it. */ |
| 319 final int sequenceNumber; | 319 final int sequenceNumber; |
| 320 | 320 |
| 321 static int _nextNumber = 0; | 321 static int _nextNumber = 0; |
| 322 | 322 |
| 323 /** Associated exception (if any) when recording errors messages. */ | 323 /** Associated exception (if any) when recording errors messages. */ |
| 324 Exception exception; | 324 Exception exception; |
| 325 | 325 |
| 326 /** Associated exception message (if any) when recording errors messages. */ | 326 /** Associated exception message (if any) when recording errors messages. */ |
| 327 String exceptionText; | 327 String exceptionText; |
| 328 | 328 |
| 329 LogRecord( | 329 LogRecord( |
| 330 this.level, this.message, this.loggerName, | 330 this.level, this.message, this.loggerName, |
| 331 [time, this.exception, this.exceptionText]) : | 331 [time, this.exception, this.exceptionText]) : |
| 332 this.time = (time == null) ? new Date.now() : time, | 332 this.time = (time == null) ? new DateTime.now() : time, |
| 333 this.sequenceNumber = LogRecord._nextNumber++; | 333 this.sequenceNumber = LogRecord._nextNumber++; |
| 334 } | 334 } |
| OLD | NEW |