The goog.debug.DebugWindow Class

goog.debug.DebugWindow(opt_identifier, opt_prefix)

Provides a debug DebugWindow that is bound to the goog.debug.Logger. It handles log messages and writes them to the DebugWindow. This doesn't provide a lot of functionality that the old Gmail logging infrastructure provided like saving debug logs for exporting to the server. Now that we have an event-based logging infrastructure, we can encapsulate that functionality in a separate class.

opt_identifier {string=}
Identifier for this logging class.
opt_prefix {string=}
Prefix prepended to messages.

How long to keep the cookies for in milliseconds

.MAX_SAVED {number}

Max number of messages to be saved

.addFilter(loggerName)

Adds a logger name to be filtered.

loggerName {string}
the logger name to add.

.addLogRecord(logRecord)

Adds a log record.

logRecord {goog.debug.LogRecord}
the LogRecord.

.addSeparator()

Adds a separator to the debug window.

.getFormatter()

Gets the formatter for outputting to the debug window. The default formatter is an instance of goog.debug.HtmlFormatter

returns {goog.debug.Formatter}
The formatter in use.

.getStyleRules()

returns {string}
The style rule text, for inclusion in the initial HTML.

.hasActiveWindow()

returns {boolean}
Whether there is an active window.

.init()

Initializes the debug window.

.isCapturing()

Whether we are currently capturing logger output.

returns {boolean}
whether we are currently capturing logger output.

.isEnabled()

Whether the DebugWindow is enabled. When the DebugWindow is enabled, it tries to keep its window open and logs all messages to the window. When the DebugWindow is disabled, it stops logging messages to its window.

returns {boolean}
Whether the DebugWindow is enabled.

.removeFilter(loggerName)

Removes a logger name to be filtered.

loggerName {string}
the logger name to remove.

.resetBufferWithNewSize(size)

Modify the size of the circular buffer. Allows the log to retain more information while the window is closed.

size {number}
New size of the circular buffer.

.setCapturing(capturing)

Sets whether we are currently capturing logger output.

capturing {boolean}
Whether to capture logger output.

.setEnabled(enable)

Sets whether the DebugWindow is enabled. When the DebugWindow is enabled, it tries to keep its window open and log all messages to the window. When the DebugWindow is disabled, it stops logging messages to its window. The DebugWindow also saves this state to a cookie so that it's persisted across application refreshes.

enable {boolean}
Whether the DebugWindow is enabled.

.setForceEnableOnSevere(enableOnSevere)

Sets whether the debug window should be force enabled when a severe log is encountered.

enableOnSevere {boolean}
Whether to enable on severe logs..

.setFormatter(formatter)

Sets the formatter for outputting to the debug window.

formatter {goog.debug.Formatter}
The formatter to use.

.setWelcomeMessage(msg)

Sets the welcome message shown when the window is first opened or reset.

msg {string}
An HTML string.