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 levels :Object

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 138](https://docs.videojs.com/utils_create-logger.js.html#line138)

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 to false will have this effect. The most restrictive.
  • all: Matches only Video.js-provided functions (debug, log, log.warn, and log.error).
  • debug: Matches log.debug, log, log.warn, and log.error calls.
  • info (default): Matches log, log.warn, and log.error calls.
  • warn: Matches log.warn and log.error calls.
  • error: Matches only log.error calls.

Methods

static createLogger(name) → {Object}

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 117](https://docs.videojs.com/utils_create-logger.js.html#line117)

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:

  1. mylogger('foo');
  2. // > VIDEOJS: player: foo
Parameters:
NameTypeDescription
namestring

The name to add call the new logger

Returns:

Object

static debug(args)

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 249](https://docs.videojs.com/utils_create-logger.js.html#line249)

Logs debug messages. Similar to console.debug, but may also act as a comparable log if console.debug is not available

Parameters:
NameTypeDescription
argsArray.<Mixed>

One or more messages or objects that should be logged as debug.

static error(args)

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 232](https://docs.videojs.com/utils_create-logger.js.html#line232)

Logs error messages. Similar to console.error.

Parameters:
NameTypeDescription
argsArray.<Mixed>

One or more messages or objects that should be logged as an error

static history() → {Array}

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 179](https://docs.videojs.com/utils_create-logger.js.html#line179)

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:

Array

static history.clear()

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 201](https://docs.videojs.com/utils_create-logger.js.html#line201)

Clears the internal history tracking, but does not prevent further history tracking.

static history.disable()

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 210](https://docs.videojs.com/utils_create-logger.js.html#line210)

Disable history tracking if it is currently enabled.

static history.enable()

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 220](https://docs.videojs.com/utils_create-logger.js.html#line220)

Enable history tracking if it is currently disabled.

static history.filter(fname) → {Array}

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 190](https://docs.videojs.com/utils_create-logger.js.html#line190)

Allows you to filter the history by the given logger name

Parameters:
NameTypeDescription
fnamestring

The name to filter by

Returns:

Array -

The filtered list to return

static level(lvlopt) → {string}

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 160](https://docs.videojs.com/utils_create-logger.js.html#line160)

Get or set the current logging level.

If a string matching a key from module:log.levels is provided, acts as a setter.

Parameters:
NameTypeAttributesDescription
lvlstring<optional>

Pass a valid level to set a new logging level.

Returns:

string -

The current logging level.

static warn(args)

[utils/create-logger.js](https://docs.videojs.com/utils_create-logger.js.html), [line 240](https://docs.videojs.com/utils_create-logger.js.html#line240)

Logs warning messages. Similar to console.warn.

Parameters:
NameTypeDescription
argsArray.<Mixed>

One or more messages or objects that should be logged as a warning.