![]() |
Infohub JS API
|
Public Member Functions | |
| constructor (options={}) | |
| debug (...args) | |
| error (...args) | |
| info (...args) | |
| setLevels (newOptions) | |
| warn (...args) | |
| constructor | ( | options = {} | ) |
Constructor for the Logger class.
| {Object} | [options={}] - Customize which levels to show (true/false for each). Defaults: { debug: true, info: true, warn: true, error: true } Example: { debug: false, info: false } to hide debug and info. |
| {boolean} | [options.debug=true] - Enable debug logs. |
| {boolean} | [options.info=true] - Enable info logs. |
| {boolean} | [options.warn=true] - Enable warn logs. |
| {boolean} | [options.error=true] - Enable error logs. |
| debug | ( | ... | ) |
Logs debug information (if enabled).
| {...any} | args - Arguments to log. |
| error | ( | ... | ) |
Logs errors (if enabled, with error in console).
| {...any} | args - Arguments to log. |
| info | ( | ... | ) |
Logs general information (if enabled).
| {...any} | args - Arguments to log. |
| setLevels | ( | newOptions | ) |
Update levels dynamically.
| {Object} | newOptions - Same as constructor options. |
| {boolean} | [newOptions.debug] - Update debug level. |
| {boolean} | [newOptions.info] - Update info level. |
| {boolean} | [newOptions.warn] - Update warn level. |
| {boolean} | [newOptions.error] - Update error level. |
| warn | ( | ... | ) |
Logs warnings (if enabled, with warn in console).
| {...any} | args - Arguments to log. |