# Class goog.debug.LogBuffer

code »

Creates the log buffer.

## Constructor

goog.debug.LogBuffer ( )

## Classes

goog.debug.LogBuffer.instance_ Creates the log buffer.

Show:Public Protected Private

## Instance Methods

code »addRecord ( level, msg, loggerName ) ⇒ `!goog.debug.LogRecord`

Adds a log record to the buffer, possibly overwriting the oldest 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.
Returns
The log record.

code »clear ( )

Removes all buffered log records.

code »forEachRecord ( func )

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

Parameters
func: `function(!goog.debug.LogRecord)` The function to call.

## Instance Properties

code »buffer_ : `!Array`

The array to store the records.

code »curIndex_ : `number`

The index of the most recently added record or -1 if there are no records.

code »isFull_ : `boolean`

Whether the buffer is at capacity.

## Static Functions

code »goog.debug.LogBuffer.getInstance ( ) ⇒ `!goog.debug.LogBuffer`

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

Returns
The LogBuffer singleton instance.

code »goog.debug.LogBuffer.isBufferingEnabled ( ) ⇒ `boolean`

Returns
Whether the log buffer is enabled.

## Static Properties

code »goog.debug.LogBuffer.goog.debug.LogBuffer.instance_ : `goog.debug.LogBuffer`

Creates the log buffer.

## Compiler Constants

code »goog.debug.LogBuffer.CAPACITY : `number`