debug.Formatter Extends
Base class for Formatters. A Formatter is used to format a LogRecord into something that can be displayed to the user.

Inheritance

Constructor

goog.debug.Formatter(opt_prefix)

Parameters

opt_prefix : string=
The prefix to place before text records.

Instance Methods

Public Protected Private
formatRecord(logRecord) string
Formats a record.
Arguments:
logRecord : goog.debug.LogRecord
the logRecord to format.
Returns: string  The formatted string.
code »
getStartTimeProvider() goog.debug.RelativeTimeProvider
Returns the start time provider. By default, this is the default instance but can be changed.
Returns: goog.debug.RelativeTimeProvider  The start time provider.
code »
resetRelativeTimeStart()
Resets the start relative time.
code »
setStartTimeProvider(provider)
Sets the start time provider. By default, this is the default instance but can be changed.
Arguments:
provider : goog.debug.RelativeTimeProvider
The provider to use.
code »

Instance Properties

appendNewline :
Whether to append newlines to the end of formatted log records.
Code »
prefix_ :
No description.
Code »
showAbsoluteTime :
Whether to show absolute time in the DebugWindow.
Code »
showExceptionText :
Whether to show the logger exception text.
Code »
showLoggerName :
Whether to show the logger name in the DebugWindow.
Code »
showRelativeTime :
Whether to show relative time in the DebugWindow.
Code »
showSeverityLevel :
Whether to show the severity level.
Code »
startTimeProvider_ : goog.debug.RelativeTimeProvider
A provider that returns the relative start time.
Code »

Static Methods

goog.debug.Formatter.getDateTimeStamp_(logRecord) string
Returns a string for the time/date of the LogRecord.
Arguments:
logRecord : goog.debug.LogRecord
The record to get a time stamp for.
Returns: string  A string representation of the time/date of the LogRecord.
code »
goog.debug.Formatter.getRelativeTime_(logRecordrelativeTimeStart) string
Returns a string for the number of seconds relative to the start time. Prepads with spaces so that anything less than 1000 seconds takes up the same number of characters for better formatting.
Arguments:
logRecord : goog.debug.LogRecord
The log to compare time to.
relativeTimeStart : number
The start time to compare to.
Returns: string  The number of seconds of the LogRecord relative to the start time.
code »
goog.debug.Formatter.getTwoDigitString_(n) string
Returns the number as a two-digit string, meaning it prepends a 0 if the number if less than 10.
Arguments:
n : number
The number to format.
Returns: string  A two-digit string representation of n.
code »

Package debug

Package Reference