UNPKG

plyr

Version:

A simple, accessible and customizable HTML5, YouTube and Vimeo media player

29 lines (22 loc) 741 B
// ========================================================================== // Console wrapper // ========================================================================== function noop() {} export default class Console { constructor(enabled = false) { this.enabled = window.console && enabled; if (this.enabled) { this.log('Debugging enabled'); } } get log() { // eslint-disable-next-line no-console return this.enabled ? Function.prototype.bind.call(console.log, console) : noop; } get warn() { return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop; } get error() { return this.enabled ? Function.prototype.bind.call(console.error, console) : noop; } }