goog.log
Functions
addHandler( logger, handler ) → void
void
Adds a handler to the logger. This doesn't use the event system because we want to be able to add logging to the event system.
Parameters |
|
---|
error( logger, msg, exception ) → void
void
Logs a message at the goog.log.Level.SEVERE level. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
Parameters |
|
---|
fine( logger, msg, exception ) → void
void
Logs a message at the goog.log.Level.FINE level. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
Parameters |
|
---|
getAllLoggers() → Array<goog.log.Logger>
Array<goog.log.Logger>
getEffectiveLevel( logger ) → goog.log.Level
goog.log.Level
Returns the effective level of the logger based on its ancestors' levels.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getLevel( logger ) → (goog.log.Level|null)
(goog.log.Level|null)
Gets the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. The level value goog.log.Level.OFF can be used to turn off logging. If the level is null, it means that this node should inherit its level from its nearest ancestor with a specific (non-null) level value.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getLogRecord( logger, level, msg, exception ) → goog.log.LogRecord
goog.log.LogRecord
Creates a log record. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. TODO(user): Delete this method from the public API.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getLogger( name, level ) → (goog.log.Logger|null)
(goog.log.Logger|null)
Finds or creates a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise, a new logger is created. If a new logger is created, it will be configured to send logging output to its parent's handlers.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getRootLogger() → (goog.log.Logger|null)
(goog.log.Logger|null)
Returns the root logger.
Parameters | None. | ||
---|---|---|---|
Returns |
|
info( logger, msg, exception ) → void
void
Logs a message at the goog.log.Level.INFO level. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
Parameters |
|
---|
isLoggable( logger, level ) → boolean
boolean
Checks if a message of the given level would actually be logged by this logger. This check is based on the goog.log.Loggers effective level, which may be inherited from its parent.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
log( logger, level, msg, exception ) → void
void
Logs a message. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. TODO(user): The level parameter should be made required.
Parameters |
|
---|
publishLogRecord( logger, logRecord ) → void
void
Logs a goog.log.LogRecord. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. TODO(user): Delete this method from the public API.
Parameters |
|
---|
removeHandler( logger, handler ) → boolean
boolean
Removes a handler from the logger. This doesn't use the event system because we want to be able to add logging to the event system.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
setLevel( logger, level ) → void
void
Set the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. The level value goog.log.Level.OFF can be used to turn off logging. If the new level is null, it means that this node should inherit its level from its nearest ancestor with a specific (non-null) level value.
Parameters |
|
---|
warning( logger, msg, exception ) → void
void
Logs a message at the goog.log.Level.WARNING level. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
Parameters |
|
---|
Properties
LogRecordHandler → function(goog.log.LogRecord): ?
function(goog.log.LogRecord): ?
A type that describes a function that handles logs.
A message value that can be handled by a goog.log.Logger.
Functions are treated like callbacks, but are only called when the event's log level is enabled. This is useful for logging messages that are expensive to construct.
ROOT_LOGGER_NAME → string
string
No information.
Compiler Constants
goog.log.ENABLED → boolean
boolean
Whether logging is enabled.