log(…args)
Logs plain debug messages. Similar to console.log.
Due to limitations of our JSDoc template, we cannot properly document this as both a function and a namespace, so its function signature is documented here.
Arguments
*args
*[]
Any combination of values that could be passed to console.log().
Return Value
undefined
| Name | Type | Attributes | Description |
|---|---|---|---|
args | * | <repeatable> | One or more messages or objects that should be logged. |
- Source
Members
(static) levels :Object
Enumeration of available logging levels, where the keys are the level names and the values are |-separated strings containing logging methods allowed in that logging level. These strings are used to create a regular expression matching the function name being called.
Levels provided by Video.js are:
off: Matches no calls. Any value that can be cast tofalsewill have this effect. The most restrictive.all: Matches only Video.js-provided functions (debug,log,log.warn, andlog.error).debug: Matcheslog.debug,log,log.warn, andlog.errorcalls.info(default): Matcheslog,log.warn, andlog.errorcalls.warn: Matcheslog.warnandlog.errorcalls.error: Matches onlylog.errorcalls.
- Object
- Source
Methods
(static) createLogger(subName, subDelimiteropt, subStylesopt) → {Object}
Create a new subLogger which chains the old name to the new name.
For example, doing videojs.log.createLogger('player') and then using that logger will log the following:
mylogger('foo');
// > VIDEOJS: player: foo
| Name | Type | Attributes | Description |
|---|---|---|---|
subName | string | The name to add call the new logger | |
subDelimiter | string | <optional> | Optional delimiter |
subStyles | string | <optional> | Optional styles |
- Source
- Type:
- Object
(static) createNewLogger(newName, newDelimiteropt, newStylesopt) → {Object}
Create a new logger.
| Name | Type | Attributes | Description |
|---|---|---|---|
newName | string | The name for the new logger | |
newDelimiter | string | <optional> | Optional delimiter |
newStyles | string | <optional> | Optional styles |
- Source
- Type:
- Object
(static) debug(…args)
Logs debug messages. Similar to console.debug, but may also act as a comparable log if console.debug is not available
| Name | Type | Attributes | Description |
|---|---|---|---|
args | * | <repeatable> | One or more messages or objects that should be logged as debug. |
- Source
(static) error(…args)
Logs error messages. Similar to console.error.
| Name | Type | Attributes | Description |
|---|---|---|---|
args | * | <repeatable> | One or more messages or objects that should be logged as an error |
- Source
(static) history() → {Array}
Returns an array containing everything that has been logged to the history.
This array is a shallow clone of the internal history record. However, its contents are not cloned; so, mutating objects inside this array will mutate them in history.
- Source
- Type:
- Array
(static) history.clear()
Clears the internal history tracking, but does not prevent further history tracking.
- Source
(static) history.disable()
Disable history tracking if it is currently enabled.
- Source
(static) history.enable()
Enable history tracking if it is currently disabled.
- Source
(static) history.filter(fname) → {Array}
Allows you to filter the history by the given logger name
| Name | Type | Description |
|---|---|---|
fname | string | The name to filter by |
- Source
The filtered list to return
- Type:
- Array
(static) level(lvlopt) → {string}
Get or set the current logging level.
If a string matching a key from module:log.levels is provided, acts as a setter.
| Name | Type | Attributes | Description |
|---|---|---|---|
lvl | 'all' | | <optional> | Pass a valid level to set a new logging level. |
- Source
The current logging level.
- Type:
- string
(static) warn(…args)
Logs warning messages. Similar to console.warn.
| Name | Type | Attributes | Description |
|---|---|---|---|
args | * | <repeatable> | One or more messages or objects that should be logged as a warning. |
- Source