diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-15 15:30:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-18 11:37:18 +0200 |
commit | 42b40636991b97fe818007fab19091764fc5db73 (patch) | |
tree | db431787c06ce898d22e91ff771f795219274fc6 /client/src/app/core/theme | |
parent | 654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff) | |
download | PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip |
Add ability for client to create server logs
Diffstat (limited to 'client/src/app/core/theme')
-rw-r--r-- | client/src/app/core/theme/theme.service.ts | 11 |
1 files changed, 6 insertions, 5 deletions
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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { logger } from '@root-helpers/logger' | ||
2 | import { capitalizeFirstLetter } from '@root-helpers/string' | 3 | import { capitalizeFirstLetter } from '@root-helpers/string' |
3 | import { UserLocalStorageKeys } from '@root-helpers/users' | 4 | import { UserLocalStorageKeys } from '@root-helpers/users' |
4 | import { HTMLServerConfig, ServerConfigTheme } from '@shared/models' | 5 | import { HTMLServerConfig, ServerConfigTheme } from '@shared/models' |
@@ -57,7 +58,7 @@ export class ThemeService { | |||
57 | private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) { | 58 | private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) { |
58 | this.themes = themes | 59 | this.themes = themes |
59 | 60 | ||
60 | console.log('Injecting %d themes.', this.themes.length) | 61 | logger.info(`Injecting ${this.themes.length} themes.`) |
61 | 62 | ||
62 | const head = this.getHeadElement() | 63 | const head = this.getHeadElement() |
63 | 64 | ||
@@ -117,13 +118,13 @@ export class ThemeService { | |||
117 | 118 | ||
118 | const currentTheme = this.getCurrentTheme() | 119 | const currentTheme = this.getCurrentTheme() |
119 | 120 | ||
120 | console.log('Enabling %s theme.', currentTheme) | 121 | logger.info(`Enabling ${currentTheme} theme.`) |
121 | 122 | ||
122 | this.loadTheme(currentTheme) | 123 | this.loadTheme(currentTheme) |
123 | 124 | ||
124 | const theme = this.getTheme(currentTheme) | 125 | const theme = this.getTheme(currentTheme) |
125 | if (theme) { | 126 | if (theme) { |
126 | console.log('Adding scripts of theme %s.', currentTheme) | 127 | logger.info(`Adding scripts of theme ${currentTheme}`) |
127 | 128 | ||
128 | this.pluginService.addPlugin(theme, true) | 129 | this.pluginService.addPlugin(theme, true) |
129 | 130 | ||
@@ -165,7 +166,7 @@ export class ThemeService { | |||
165 | this.injectThemes([ lastActiveTheme ], true) | 166 | this.injectThemes([ lastActiveTheme ], true) |
166 | this.updateCurrentTheme() | 167 | this.updateCurrentTheme() |
167 | } catch (err) { | 168 | } catch (err) { |
168 | console.error('Cannot parse last active theme.', err) | 169 | logger.error('Cannot parse last active theme.', err) |
169 | return | 170 | return |
170 | } | 171 | } |
171 | } | 172 | } |
@@ -173,7 +174,7 @@ export class ThemeService { | |||
173 | private removeThemePlugins (themeName: string) { | 174 | private removeThemePlugins (themeName: string) { |
174 | const oldTheme = this.getTheme(themeName) | 175 | const oldTheme = this.getTheme(themeName) |
175 | if (oldTheme) { | 176 | if (oldTheme) { |
176 | console.log('Removing scripts of old theme %s.', themeName) | 177 | logger.info(`Removing scripts of old theme ${themeName}.`) |
177 | this.pluginService.removePlugin(oldTheme) | 178 | this.pluginService.removePlugin(oldTheme) |
178 | } | 179 | } |
179 | } | 180 | } |