Home

# Class goog.debug.DebugWindow

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.

Instance Method Summary
| `addFilter(string loggerName)` Adds a logger name to be filtered.
| `addLogRecord(?goog.debug.LogRecord logRecord)` Adds a log record.
| `addSeparator()` Adds a separator to the debug window.
| `clear_()` Clears the contents of the debug window
| `getCookie_(string key, string= opt_default) ⇒ string` Retrieve data (using cookies).
| `getFormatter() ⇒ ?goog.debug.Formatter` Gets the formatter for outputting to the debug window. The default formatter is an instance of goog.debug.HtmlFormatter
| `getStyleRules() ⇒ string`
| `getWindowName_() ⇒ string` Gets a valid window name for the debug window. Replaces invalid characters in IE.
| `hasActiveWindow() ⇒ boolean`
| `init()` Initializes the debug window.
| `isCapturing() ⇒ boolean` Whether we are currently capturing logger output.
| `isEnabled() ⇒ boolean` 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.
| `openWindow_()` Opens the debug window if it is not already referenced
| `removeFilter(string loggerName)` Removes a logger name to be filtered.
| `resetBufferWithNewSize(number size)` Modify the size of the circular buffer. Allows the log to retain more information while the window is closed.
| `saveWindowPositionSize_()` Saves the window position size to a cookie
| `setCapturing(boolean capturing)` Sets whether we are currently capturing logger output.
| `setCookie_(string key, string value)` Save persistent data (using cookies) for 1 month (cookie specific to this logger object)
| `setEnabled(boolean 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.
| `setForceEnableOnSevere(boolean enableOnSevere)` Sets whether the debug window should be force enabled when a severe log is encountered.
| `setFormatter(?goog.debug.Formatter formatter)` Sets the formatter for outputting to the debug window.
| `setWelcomeMessage(string msg)` Sets the welcome message shown when the window is first opened or reset.
| `writeBufferToLog_()` Write to the log and maybe scroll into view
| `writeInitialDocument_()` Writes the initial HTML of the debug window
| `writeSavedMessages_()` Writes all saved messages to the DebugWindow.
| `writeToLog_(string html)` Write to the buffer. If a message hasn't been sent for more than 750ms just write, otherwise delay for a minimum of 250ms.
| `write_(string html)` Writes a message to the log, possibly opening up the window if it's enabled, or saving it if it's disabled.

Static Method Summary
| `getCookieValue_(string identifier, string key, string= opt_default) ⇒ string` Retrieve data (using cookies).
| `isEnabled(string identifier) ⇒ boolean`