Logger¶
- class Logger(name)¶
The logger class which can be used to log messages to the JavaScript console.
This is basically a wrapper around
console.…()
, but it adds functionality to handle debug logs by introducing a persistent debug mode.Hint
Have a look at Debugging components if you want to know how to debug components. Also have a look at
debug()
andenableDebug()
to see how debug log messages are handled.- Logger.debug(...message)¶
Log a debug message to the console.
Important
By default, debug logs are deactivated and not logged to the console at all. This is due to browser performance issues on extensive logging usage.
Thus, if you want to see debug logs, you’ve to explicitly activate them via
enableDebug()
.- Arguments:
message (Array) – The logging message
- Logger.error(...message)¶
Log an error message to the console.
- Arguments:
message (Array) – The logging message
- Logger.info(...message)¶
Log an info message to the console.
- Arguments:
message (Array) – The logging message
- Logger.warn(...message)¶
Log a warning message to the console.
- Arguments:
message (Array) – The logging message
- static Logger.disableDebug(...components)¶
Disable debug mode for one or multiple components.
- Arguments:
components (Array) – The names of the components to disable debugging for
- Returns:
Array – The enabled debug components
- static Logger.enableDebug(...components)¶
Enable debug mode for one or multiple components.
Hint
Enabling the debug mode is persistent over site reloads and even browser restarts. This is achieved by storing the debug component names in the local storage of the browser.
- Arguments:
components (Array) – The names of the components to activate debugging for
- Returns:
Array – The enabled debug components
- static Logger.resetDebug()¶
Reset the debug mode for all components.