Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log level feature #2613

Merged

Conversation

epiclabsDASH
Copy link
Contributor

Improves the logging system so it works with log levels (as requested in #2601).

A couple of methods have been created in Debug class to allow developers to set/retrieve the log level:

  • Debug.setLogLevel
  • Debug.getLogLevel

The following log levels are supported:

  • dashjs.Debug.LOG_LEVEL_DEBUG: what we have today. Everything.
  • dashjs.Debug.LOG_LEVEL_INFO: key events (ex: segment loaded, bitrate changes).
  • dashjs.Debug.LOG_LEVEL_WARNING: (ex: timecode jumping, fetch is not available, EME not available, adaptations set that are not supported, semantic problems with the mpd that dont avoid playback to start).
  • dashjs.Debug.LOG_LEVEL_ERROR: errors that don't stop playback (ex: segment 404, codec errors - fallback).
  • dashjs.Debug.LOG_LEVEL_FATAL: Playback fails completely (codecs not supported).

With the new approach, any dash.js class that wants to use the new Logger has to create its own Logger instance. Example:

logger = Debug(context).getInstance().getLogger(instance);
logger.warn('This is a warning message');

Additionally:

  • Method Debug.setLogToBrowserConsole has been deprecated and will be removed two versions after current one (v2.7.0)
  • Method Debug.getLogToBrowserConsole has been deprecated and will be removed two versions after current one (v2.7.0)
  • Event Events.LOG has been deprecated and will be removed two versions after current one (v2.7.0)

Documentation, definition file and unit tests updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants