# Class goog.debug.LogRecord

code »

LogRecord objects are used to pass logging requests between the logging framework and individual log Handlers.

## Constructor

goog.debug.LogRecord ( level, msg, loggerName, opt_time, opt_sequenceNumber )

Parameters
level: `goog.debug.Logger.Level` One of the level identifiers. msg: `string` The string message. loggerName: `string` The name of the source logger. opt_time: `number=` Time this log record was created if other than now. If 0, we use #goog.now. opt_sequenceNumber: `number=` Sequence number of this log record. This should only be passed in when restoring a log record from persistence.

Show:Public Protected Private

## Instance Methods

code »getException ( ) ⇒ `Object`

Get the exception that is part of the log record.

Returns
the exception.

code »getExceptionText ( ) ⇒ `?string`

Get the exception text that is part of the log record.

Returns
Exception text.

code »getLevel ( ) ⇒ `goog.debug.Logger.Level`

Get the logging message level, for example Level.SEVERE.

Returns
the logging message level.

code »getLoggerName ( ) ⇒ `string`

Get the source Logger's name.

Returns
source logger name (may be null).

code »getMessage ( ) ⇒ `string`

Get the "raw" log message, before localization or formatting.

Returns
the raw message string.

code »getMillis ( ) ⇒ `number`

Get event time in milliseconds since 1970.

Returns
event time in millis since 1970.

code »getSequenceNumber ( ) ⇒ `number`

Get the sequence number.

Sequence numbers are normally assigned in the LogRecord constructor, which assigns unique sequence numbers to each new LogRecord in increasing order.

Returns
the sequence number.

code »reset ( level, msg, loggerName, opt_time, opt_sequenceNumber )

Sets all fields of the log record.

Parameters
level: `goog.debug.Logger.Level` One of the level identifiers. msg: `string` The string message. loggerName: `string` The name of the source logger. opt_time: `number=` Time this log record was created if other than now. If 0, we use #goog.now. opt_sequenceNumber: `number=` Sequence number of this log record. This should only be passed in when restoring a log record from persistence.

code »setException ( exception )

Set the exception that is part of the log record.

Parameters
exception: `Object` the exception.

code »setExceptionText ( text )

Set the exception text that is part of the log record.

Parameters
text: `string` The exception text.

code »setLevel ( level )

Set the logging message level, for example Level.SEVERE.

Parameters
level: `goog.debug.Logger.Level` the logging message level.

code »setLoggerName ( loggerName )

Get the source Logger's name.

Parameters
loggerName: `string` source logger name (may be null).

code »setMessage ( msg )

Set the "raw" log message, before localization or formatting.

Parameters
msg: `string` the raw message string.

code »setMillis ( time )

Set event time in milliseconds since 1970.

Parameters
time: `number` event time in millis since 1970.

## Instance Properties

code »exceptionText_ : `?string`

Exception text associated with the record

code »exception_ : `Object`

Exception associated with the record

code »level_ : `goog.debug.Logger.Level`

Level of the LogRecord

code »loggerName_ : `string`

Name of the logger that created the record.

code »msg_ : `string`

Message associated with the record

code »sequenceNumber_ : `number`

Sequence number for the LogRecord. Each record has a unique sequence number that is greater than all log records created before it.

code »time_ : `number`

Time the LogRecord was created.

## Static Properties

code »goog.debug.LogRecord.nextSequenceNumber_ : `number`

A sequence counter for assigning increasing sequence numbers to LogRecord objects.

## Compiler Constants

code »goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS : `boolean`