Constructor
new Logger(name, opt_levelopt)
Name | Type | Attributes | Description |
---|---|---|---|
name | string | the name of this logger. | |
opt_level | Level | <optional> | the initial level for this logger. |
- Source
Methods
addHandler(handler)
Adds a handler to this logger. The handler will be invoked for each message logged with this instance, or any of its descendants.
Name | Type | Description |
---|---|---|
handler | function | the handler to add. |
- Source
debug(loggable)
Logs a message at the Level.DEBUG log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
fine(loggable)
Logs a message at the Level.FINE log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
finer(loggable)
Logs a message at the Level.FINER log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
finest(loggable)
Logs a message at the Level.FINEST log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
getEffectiveLevel() → (non-null) {Level}
- Source
the effective level for this logger.
- Type:
- Level
getLevel() → {Level}
- Source
the log level for this logger.
- Type:
- Level
getName() → {string}
- Source
the name of this logger.
- Type:
- string
info(loggable)
Logs a message at the Level.INFO log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
isLoggable(levelnon-null) → {boolean}
Name | Type | Description |
---|---|---|
level | Level | the level to check. |
- Source
whether messages recorded at the given level are loggable by this instance.
- Type:
- boolean
log(levelnon-null, loggable)
Logs a message at the given level. The message may be defined as a string or as a function that will return the message. If a function is provided, it will only be invoked if this logger's effective log level includes the given level
.
Name | Type | Description |
---|---|---|
level | Level | the level at which to log the message. |
loggable | string | | the message to log, or a function that will return the message. |
- Source
removeHandler(handler) → {boolean}
Removes a handler from this logger.
Name | Type | Description |
---|---|---|
handler | function | the handler to remove. |
- Source
whether a handler was successfully removed.
- Type:
- boolean
setLevel(level)
Name | Type | Description |
---|---|---|
level | Level | the new level for this logger, or |
- Source
severe(loggable)
Logs a message at the Level.SEVERE log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source
warning(loggable)
Logs a message at the Level.WARNING log level.
Name | Type | Description |
---|---|---|
loggable | string | | the message to log, or a function that will return the message. |
- Source