aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/notification/notifier.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-15 15:30:14 +0200
committerChocobozzz <me@florianbigard.com>2022-07-18 11:37:18 +0200
commit42b40636991b97fe818007fab19091764fc5db73 (patch)
treedb431787c06ce898d22e91ff771f795219274fc6 /client/src/app/core/notification/notifier.service.ts
parent654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff)
downloadPeerTube-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/notification/notifier.service.ts')
-rw-r--r--client/src/app/core/notification/notifier.service.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/core/notification/notifier.service.ts b/client/src/app/core/notification/notifier.service.ts
index 165bb0c76..15af5c1b6 100644
--- a/client/src/app/core/notification/notifier.service.ts
+++ b/client/src/app/core/notification/notifier.service.ts
@@ -1,5 +1,6 @@
1import { MessageService } from 'primeng/api' 1import { MessageService } from 'primeng/api'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import { logger } from '@root-helpers/logger'
3 4
4@Injectable() 5@Injectable()
5export class Notifier { 6export class Notifier {
@@ -10,21 +11,21 @@ export class Notifier {
10 info (text: string, title?: string, timeout?: number, sticky?: boolean) { 11 info (text: string, title?: string, timeout?: number, sticky?: boolean) {
11 if (!title) title = $localize`Info` 12 if (!title) title = $localize`Info`
12 13
13 console.info(`${title}: ${text}`) 14 logger.info(`${title}: ${text}`)
14 return this.notify('info', text, title, timeout, sticky) 15 return this.notify('info', text, title, timeout, sticky)
15 } 16 }
16 17
17 error (text: string, title?: string, timeout?: number, sticky?: boolean) { 18 error (text: string, title?: string, timeout?: number, sticky?: boolean) {
18 if (!title) title = $localize`Error` 19 if (!title) title = $localize`Error`
19 20
20 console.error(`${title}: ${text}`) 21 logger.error(`${title}: ${text}`)
21 return this.notify('error', text, title, timeout, sticky) 22 return this.notify('error', text, title, timeout, sticky)
22 } 23 }
23 24
24 success (text: string, title?: string, timeout?: number, sticky?: boolean) { 25 success (text: string, title?: string, timeout?: number, sticky?: boolean) {
25 if (!title) title = $localize`Success` 26 if (!title) title = $localize`Success`
26 27
27 console.log(`${title}: ${text}`) 28 logger.info(`${title}: ${text}`)
28 return this.notify('success', text, title, timeout, sticky) 29 return this.notify('success', text, title, timeout, sticky)
29 } 30 }
30 31