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
Mixed[]
Any combination of values that could be passed to console.log().
Return Value
undefined
Members
-
static module:create-logger~createLogger~log.levelsObject
-
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.
Methods
-
staticmodule:create-logger~createLogger~log.createLogger(name){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: fooName Type Description namestring The name to add call the new logger
Returns:
Type Description Object -
staticmodule:create-logger~createLogger~log.debug(args)
-
Logs debug messages. Similar to
console.debug, but may also act as a comparable log ifconsole.debugis not availableName Type Description argsArray.<Mixed> One or more messages or objects that should be logged as debug.
-
staticmodule:create-logger~createLogger~log.error(args)
-
Logs error messages. Similar to
console.error.Name Type Description argsArray.<Mixed> One or more messages or objects that should be logged as an error
-
staticmodule:create-logger~createLogger~log.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.
Returns:
Type Description Array -
staticmodule:create-logger~createLogger~log.history.clear()
-
Clears the internal history tracking, but does not prevent further history tracking.
-
staticmodule:create-logger~createLogger~log.history.disable()
-
Disable history tracking if it is currently enabled.
-
staticmodule:create-logger~createLogger~log.history.enable()
-
Enable history tracking if it is currently disabled.
-
staticmodule:create-logger~createLogger~log.history.filter(fname){Array}
-
Allows you to filter the history by the given logger name
Name Type Description fnamestring The name to filter by
Returns:
Type Description Array The filtered list to return -
staticmodule:create-logger~createLogger~log.level(lvl){string}
-
Get or set the current logging level.
If a string matching a key from
module:log.levelsis provided, acts as a setter.Name Type Description lvlstring optional Pass a valid level to set a new logging level.
Returns:
Type Description string The current logging level. -
staticmodule:create-logger~createLogger~log.warn(args)
-
Logs warning messages. Similar to
console.warn.Name Type Description argsArray.<Mixed> One or more messages or objects that should be logged as a warning.