Namespace: webdriver.logging
View Source

# class LogRecord

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

### new LogRecord(level, msg, loggerName, opt_time, opt_sequenceNumber)

Parameters

level`webdriver.logging.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.

## Instance Methods

### getException()code »

Get the exception that is part of the log record.

Returns

`Object`

  the exception.

### getLevel()code »

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

Returns

`webdriver.logging.Level`

  the logging message level.

### getLoggerName()code »

Get the source Logger's name.

Returns

`string`

  source logger name (may be null).

### getMessage()code »

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

Returns

`string`

  the raw message string.

### getMillis()code »

Get event time in milliseconds since 1970.

Returns

`number`

  event time in millis since 1970.

### getSequenceNumber()code »

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

`number`

  the sequence number.

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

Sets all fields of the log record.

Parameters

level`webdriver.logging.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.

### setException(exception)code »

Set the exception that is part of the log record.

Parameters

exception`Object`

  the exception.

### setLevel(level)code »

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

Parameters

level`webdriver.logging.Level`

  the logging message level.

### setLoggerName(loggerName)code »

Get the source Logger's name.

Parameters

loggerName`string`

  source logger name (may be null).

### setMessage(msg)code »

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

Parameters

msg`string`

  the raw message string.

### setMillis(time)code »

Set event time in milliseconds since 1970.

Parameters

time`number`

  event time in millis since 1970.

## Compiler Constants

LogRecord.ENABLE_SEQUENCE_NUMBERS `boolean`

  Whether to enable log sequence numbers.