The goog.debug.LogBuffer Class

goog.debug.LogBuffer()

Creates the log buffer.

.CAPACITY

.addRecord(level, msg, loggerName)

Adds a log record to the buffer, possibly overwriting the oldest record.

level {goog.debug.Logger.Level}
One of the level identifiers.
msg {string}
The string message.
loggerName {string}
The name of the source logger.
returns {!goog.debug.LogRecord}
The log record.

.clear()

Removes all buffered log records.

.forEachRecord(func)

Calls the given function for each buffered log record, starting with the oldest one.

func {function(!goog.debug.LogRecord)}
The function to call.

.getInstance()

A static method that always returns the same instance of LogBuffer.

returns {!goog.debug.LogBuffer}
The LogBuffer singleton instance.

.isBufferingEnabled()

returns {boolean}
Whether the log buffer is enabled.