Lightweight styled console logging utility.
Drop-in replacement for the log function currently in constants.js.
Usage:
import log from './log';
log('Hello'); // plain message
log('Initialized.', 'initUI'); // scoped message
log.warn('Slow frame', 'Renderer'); // severity shorthand
log.error('GL context lost', 'WebGL');
log.debug('Pan delta', 'Mouse');
- Source:
Members
(static, constant) LOG_LEVEL :string
Type:
- string
- Source:
Methods
(inner) log(message, scopeopt, severityopt)
Logs a styled message to the console.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message |
string | The message to log. | ||
scope |
string |
<optional> |
'' | Optional scope/context label shown in brackets. |
severity |
string |
<optional> |
LOG_LEVEL.LOG | Severity level from LOG_LEVEL. |
- Source: