The goog.debug.LogRecord Class

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

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

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.

.ENABLE_SEQUENCE_NUMBERS

.getException()

Get the exception that is part of the log record.

returns {Object}
the exception.

.getExceptionText()

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

returns {?string}
Exception text.

.getLevel()

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

returns {goog.debug.Logger.Level}
the logging message level.

.getLoggerName()

Get the source Logger's name.

returns {string}
source logger name (may be null).

.getMessage()

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

returns {string}
the raw message string.

.getMillis()

Get event time in milliseconds since 1970.

returns {number}
event time in millis since 1970.

.getSequenceNumber()

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)

Sets all fields of the log record.

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.

.setException(exception)

Set the exception that is part of the log record.

exception {Object}
the exception.

.setExceptionText(text)

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

text {string}
The exception text.

.setLevel(level)

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

level {goog.debug.Logger.Level}
the logging message level.

.setLoggerName(loggerName)

Get the source Logger's name.

loggerName {string}
source logger name (may be null).

.setMessage(msg)

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

msg {string}
the raw message string.

.setMillis(time)

Set event time in milliseconds since 1970.

time {number}
event time in millis since 1970.