From 42b40636991b97fe818007fab19091764fc5db73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Jul 2022 15:30:14 +0200 Subject: Add ability for client to create server logs --- client/src/assets/player/shared/peertube/peertube-plugin.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/assets/player/shared/peertube/peertube-plugin.ts') diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts index a29a0921f..69a7b2d65 100644 --- a/client/src/assets/player/shared/peertube/peertube-plugin.ts +++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts @@ -1,5 +1,6 @@ import debug from 'debug' import videojs from 'video.js' +import { logger } from '@root-helpers/logger' import { isMobile } from '@root-helpers/web-browser' import { timeToInt } from '@shared/core-utils' import { VideoView, VideoViewEvent } from '@shared/models/videos' @@ -15,7 +16,7 @@ import { import { PeerTubePluginOptions, VideoJSCaption } from '../../types' import { SettingsButton } from '../settings/settings-menu-button' -const logger = debug('peertube:player:peertube') +const debugLogger = debug('peertube:player:peertube') const Plugin = videojs.getPlugin('plugin') @@ -176,7 +177,7 @@ class PeerTubePlugin extends Plugin { lastCurrentTime = currentTime this.notifyUserIsWatching(currentTime, lastViewEvent) - .catch(err => console.error('Cannot notify user is watching.', err)) + .catch(err => logger.error('Cannot notify user is watching.', err)) lastViewEvent = undefined @@ -249,7 +250,7 @@ class PeerTubePlugin extends Plugin { (this.player as any).cache_.inactivityTimeout = timeout this.player.options_.inactivityTimeout = timeout - logger('Set player inactivity to ' + timeout) + debugLogger('Set player inactivity to ' + timeout) } private initCaptions () { -- cgit v1.2.3