goog.debug.DebugWindow
Classgoog.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
=}
opt_prefix
{string
=}
.COOKIE_TIME
{number
}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
}
.addLogRecord(logRecord)
Adds a log record.
logRecord
{goog.debug.LogRecord
}
.addSeparator()
Adds a separator to the debug window.
.clear_()
[protected]Clears the contents of the debug window
.getFormatter()
Gets the formatter for outputting to the debug window. The default formatter is an instance of goog.debug.HtmlFormatter
goog.debug.Formatter
}
.getStyleRules()
string
}
.hasActiveWindow()
boolean
}
.identifier_
[protected] {string
}Identifier for this logging class
.init()
Initializes the debug window.
.isCapturing()
Whether we are currently capturing logger output.
boolean
}
.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.
boolean
}
.lastCall_
[protected] {number
}Timestamp for the last time the log was written to.
.outputBuffer_
[protected] {Array
}Array used to buffer log output
.removeFilter(loggerName)
Removes a logger name to be filtered.
loggerName
{string
}
.resetBufferWithNewSize(size)
Modify the size of the circular buffer. Allows the log to retain more information while the window is closed.
size
{number
}
.setCapturing(capturing)
Sets whether we are currently capturing logger output.
capturing
{boolean
}
.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
}
.setForceEnableOnSevere(enableOnSevere)
Sets whether the debug window should be force enabled when a severe log is encountered.
enableOnSevere
{boolean
}
.setFormatter(formatter)
Sets the formatter for outputting to the debug window.
formatter
{goog.debug.Formatter
}
.setWelcomeMessage(msg)
Sets the welcome message shown when the window is first opened or reset.
msg
{string
}
.welcomeMessage
[protected] {string
}HTML string printed when the debug window opens
.win_
[protected] {Window
}Reference to debug window
.writeBufferToLog()
[protected]Write to the log and maybe scroll into view.
.writeInitialDocument()
[protected]Writes the initial HTML of the debug window.
.writeSavedMessages_()
[protected]Writes all saved messages to the DebugWindow.