Constructor
new Log(plugin)
Name | Type | Description |
---|---|---|
plugin | Object | Plugin instance |
- Source
Methods
child() → {Object}
Create child logger
- Source
Child logger instance
- Type:
- Object
debug(…params)
Display & format message as debug
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
error(…params)
Display & format message as error
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
fatal(…params)
Display & format message as fatal
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
formatMsg(level, …params)
Display & format message according to one of these rules:
level
text
var 1
var 2
...var n
- Translatetext
and interpolate withvars
for levellevel
level
data
text
var 1
var 2
...var n
- As above, and append stringifieddata
level
error
- Format as error. If current log level is trace, dump the error object on screen
Name | Type | Attributes | Description |
---|---|---|---|
level | string | Log level to use | |
params | any | <repeatable> | See format above |
- Source
info(…params)
Display & format message as info
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
init()
Initialize logger. Auto detect to use different logger via Bajo's config file
- Source
isExtLogger() → {boolean}
Do we use external logger or Bajo's built-in one?
- Source
- Type:
- boolean
isIgnored(level) → {boolean}
Is provided level being ignored by config?
Name | Type | Description |
---|---|---|
level | string | Log level |
- Source
- Type:
- boolean
trace(…params)
Display & format message as trace
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
warn(…params)
Display & format message as warn
level. See formatMsg for details
Name | Type | Attributes | Description |
---|---|---|---|
params | any | <repeatable> |
- Source
write(text, …argsopt) → {string}
Interpolate and translate text via plugin's print engine. Check Print class for more information
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text pattern to use | |
args | any | <optional> <repeatable> | Variables to interpolate with text pattern above |
- Source
Interpolated & translated text
- Type:
- string