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/app/modal/account-setup-warning-modal.component.ts | 3 ++- client/src/app/modal/admin-welcome-modal.component.ts | 3 ++- client/src/app/modal/custom-modal.component.ts | 5 +++-- client/src/app/modal/instance-config-warning-modal.component.ts | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'client/src/app/modal') diff --git a/client/src/app/modal/account-setup-warning-modal.component.ts b/client/src/app/modal/account-setup-warning-modal.component.ts index c4cbf92b6..b999a3407 100644 --- a/client/src/app/modal/account-setup-warning-modal.component.ts +++ b/client/src/app/modal/account-setup-warning-modal.component.ts @@ -1,6 +1,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core' import { Notifier, ServerService, User, UserService } from '@app/core' import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' +import { logger } from '@root-helpers/logger' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' @Component({ @@ -71,7 +72,7 @@ export class AccountSetupWarningModalComponent { this.userService.updateMyProfile({ noAccountSetupWarningModal: true }) .subscribe({ - next: () => console.log('We will not open the account setup modal again.'), + next: () => logger.info('We will not open the account setup modal again.'), error: err => this.notifier.error(err.message) }) diff --git a/client/src/app/modal/admin-welcome-modal.component.ts b/client/src/app/modal/admin-welcome-modal.component.ts index 3679f0847..7a9b89d3d 100644 --- a/client/src/app/modal/admin-welcome-modal.component.ts +++ b/client/src/app/modal/admin-welcome-modal.component.ts @@ -1,6 +1,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core' import { Notifier, User, UserService } from '@app/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { logger } from '@root-helpers/logger' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' @Component({ @@ -42,7 +43,7 @@ export class AdminWelcomeModalComponent { this.userService.updateMyProfile({ noWelcomeModal: true }) .subscribe({ - next: () => console.log('We will not open the welcome modal again.'), + next: () => logger.info('We will not open the welcome modal again.'), error: err => this.notifier.error(err.message) }) diff --git a/client/src/app/modal/custom-modal.component.ts b/client/src/app/modal/custom-modal.component.ts index 559230e04..49343ae71 100644 --- a/client/src/app/modal/custom-modal.component.ts +++ b/client/src/app/modal/custom-modal.component.ts @@ -1,5 +1,6 @@ -import { Component, ElementRef, ViewChild, Input } from '@angular/core' +import { Component, ElementRef, Input, ViewChild } from '@angular/core' import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' +import { logger } from '@root-helpers/logger' @Component({ selector: 'my-custom-modal', @@ -29,7 +30,7 @@ export class CustomModalComponent { confirm?: { value: string, action?: () => void } }) { if (this.modalRef instanceof NgbModalRef && this.modalService.hasOpenModals()) { - console.error('Cannot open another custom modal, one is already opened.') + logger.error('Cannot open another custom modal, one is already opened.') return } diff --git a/client/src/app/modal/instance-config-warning-modal.component.ts b/client/src/app/modal/instance-config-warning-modal.component.ts index 300738a41..23c2c777e 100644 --- a/client/src/app/modal/instance-config-warning-modal.component.ts +++ b/client/src/app/modal/instance-config-warning-modal.component.ts @@ -2,6 +2,7 @@ import { Location } from '@angular/common' import { Component, ElementRef, ViewChild } from '@angular/core' import { Notifier, User, UserService } from '@app/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { logger } from '@root-helpers/logger' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' import { About, ServerConfig } from '@shared/models/server' @@ -64,7 +65,7 @@ export class InstanceConfigWarningModalComponent { this.userService.updateMyProfile({ noInstanceConfigWarningModal: true }) .subscribe({ - next: () => console.log('We will not open the instance config warning modal again.'), + next: () => logger.info('We will not open the instance config warning modal again.'), error: err => this.notifier.error(err.message) }) -- cgit v1.2.3