Skip to content

Logging

dash.js defines different cumulative log levels to output information in the console during playback. For example, if you set the log level to dashjs.Debug.LOG_LEVEL_WARNING all warnings, errors and fatals will be logged.

Example

An example is available as part of the sample section.

Log level

Log levelNumeric valueDescription
dashjs.Debug.LOG_LEVEL_NONE0No message is written in the browser console
dashjs.Debug.LOG_LEVEL_FATAL1Log fatal errors. An error is considered fatal when it causes playback to fail completely.
dashjs.Debug.LOG_LEVEL_ERROR2Log error messages
dashjs.Debug.LOG_LEVEL_WARNING3Log warning messages
dashjs.Debug.LOG_LEVEL_INFO4Log info messages
dashjs.Debug.LOG_LEVEL_DEBUG5Log all messages

Setting the log level

To set the target log level simply update the settings with the desired value, for instance

javascript
player.updateSettings({
    'debug': {
        'logLevel': dashjs.Debug.LOG_LEVEL_INFO
    }
});

or

javascript
player.updateSettings({
    'debug': {
        'logLevel': 4
    }
});