Skip to content

Commit

Permalink
fix(Tizen): Fix exceptions thrown from logging methods
Browse files Browse the repository at this point in the history
PR shaka-project#5050 unboxed the console log methods, which broke logging on
Tizen.  This change was never released.

This fixes the issue by using arrow functions to prevent unboxing.
  • Loading branch information
joeyparrish committed Mar 7, 2023
1 parent eb01c60 commit aeb2c18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/debug/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ shaka.log.oneTimeWarningIssued_ = new Set();
if (window.console) {
/** @private {!Object.<shaka.log.Level, function(...*)>} */
shaka.log.logMap_ = {
[shaka.log.Level.ERROR]: console.error,
[shaka.log.Level.WARNING]: console.warn,
[shaka.log.Level.INFO]: console.info,
[shaka.log.Level.DEBUG]: console.log,
[shaka.log.Level.V1]: console.debug,
[shaka.log.Level.V2]: console.debug,
[shaka.log.Level.ERROR]: (...args) => console.error(...args),
[shaka.log.Level.WARNING]: (...args) => console.warn(...args),
[shaka.log.Level.INFO]: (...args) => console.info(...args),
[shaka.log.Level.DEBUG]: (...args) => console.log(...args),
[shaka.log.Level.V1]: (...args) => console.debug(...args),
[shaka.log.Level.V2]: (...args) => console.debug(...args),
};

shaka.log.alwaysWarn = (...args) => console.warn(...args);
Expand Down

0 comments on commit aeb2c18

Please sign in to comment.