Dart DocumentationloggingLogRecord

LogRecord class

A log entry representation used to propagate information from Logger to individual Handlers.

class LogRecord {
 final Level level;
 final String message;

 /** Logger where this record is stored. */
 final String loggerName;

 /** Time when this record was created. */
 final DateTime time;

 /** Unique sequence number greater than all log records created before it. */
 final int sequenceNumber;

 static int _nextNumber = 0;

 /** Associated exception (if any) when recording errors messages. */
 var exception;

 LogRecord(this.level, this.message, this.loggerName, [this.exception])
     : time = new DateTime.now(),
       sequenceNumber = LogRecord._nextNumber++;
}

Constructors

new LogRecord(Level level, String message, String loggerName, [exception]) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
LogRecord(this.level, this.message, this.loggerName, [this.exception])
   : time = new DateTime.now(),
     sequenceNumber = LogRecord._nextNumber++;

Properties

var exception #

Associated exception (if any) when recording errors messages.

var exception

final Level level #

final Level level

final String loggerName #

Logger where this record is stored.

final String loggerName

final String message #

final String message

final int sequenceNumber #

Unique sequence number greater than all log records created before it.

final int sequenceNumber

final DateTime time #

Time when this record was created.

final DateTime time