X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Ftheme%2Ftheme.service.ts;h=ead1770ba1b30bd87fe0e5ddeb617f3b53885439;hb=2c8380a46f34631e705b1564938343cacfa4b0bc;hp=40939ecb85ebb01cafe9ac04bfb2ff3665a914e3;hpb=00fe5d61369b1769c62686e5bd8e6e666f867598;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index 40939ecb8..ead1770ba 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core' +import { logger } from '@root-helpers/logger' import { capitalizeFirstLetter } from '@root-helpers/string' import { UserLocalStorageKeys } from '@root-helpers/users' import { HTMLServerConfig, ServerConfigTheme } from '@shared/models' @@ -57,7 +58,7 @@ export class ThemeService { private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) { this.themes = themes - console.log('Injecting %d themes.', this.themes.length) + logger.info(`Injecting ${this.themes.length} themes.`) const head = this.getHeadElement() @@ -117,13 +118,13 @@ export class ThemeService { const currentTheme = this.getCurrentTheme() - console.log('Enabling %s theme.', currentTheme) + logger.info(`Enabling ${currentTheme} theme.`) this.loadTheme(currentTheme) const theme = this.getTheme(currentTheme) if (theme) { - console.log('Adding scripts of theme %s.', currentTheme) + logger.info(`Adding scripts of theme ${currentTheme}`) this.pluginService.addPlugin(theme, true) @@ -165,7 +166,7 @@ export class ThemeService { this.injectThemes([ lastActiveTheme ], true) this.updateCurrentTheme() } catch (err) { - console.error('Cannot parse last active theme.', err) + logger.error('Cannot parse last active theme.', err) return } } @@ -173,7 +174,7 @@ export class ThemeService { private removeThemePlugins (themeName: string) { const oldTheme = this.getTheme(themeName) if (oldTheme) { - console.log('Removing scripts of old theme %s.', themeName) + logger.info(`Removing scripts of old theme ${themeName}.`) this.pluginService.removePlugin(oldTheme) } }