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 --- .../src/app/shared/shared-main/angular/defer-loading.directive.ts | 4 ++-- client/src/app/shared/shared-main/misc/list-overflow.component.ts | 6 +++--- client/src/app/shared/shared-main/users/user-notification.model.ts | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared/shared-main') diff --git a/client/src/app/shared/shared-main/angular/defer-loading.directive.ts b/client/src/app/shared/shared-main/angular/defer-loading.directive.ts index 9a10e90e3..53d6e70ba 100644 --- a/client/src/app/shared/shared-main/angular/defer-loading.directive.ts +++ b/client/src/app/shared/shared-main/angular/defer-loading.directive.ts @@ -13,7 +13,7 @@ import { ViewContainerRef } from '@angular/core' -const logger = debug('peertube:main:DeferLoadingDirective') +const debugLogger = debug('peertube:main:DeferLoadingDirective') @Directive({ selector: '[myDeferLoading]' @@ -52,7 +52,7 @@ export class DeferLoadingDirective implements AfterViewInit, OnDestroy { load () { if (this.isLoaded()) return - logger('Loading component') + debugLogger('Loading component') this.viewContainer.clear() this.view = this.viewContainer.createEmbeddedView(this.template, {}, 0) diff --git a/client/src/app/shared/shared-main/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts index 541991f74..7e4e1b1d1 100644 --- a/client/src/app/shared/shared-main/misc/list-overflow.component.ts +++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts @@ -17,7 +17,7 @@ import { ScreenService } from '@app/core' import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' import * as debug from 'debug' -const logger = debug('peertube:main:ListOverflowItem') +const debugLogger = debug('peertube:main:ListOverflowItem') export interface ListOverflowItem { label: string @@ -66,7 +66,7 @@ export class ListOverflowComponent implements AfterV let showItemsUntilIndexExcluded: number let accWidth = 0 - logger('Parent width is %d', parentWidth) + debugLogger('Parent width is %d', parentWidth) for (const [ index, el ] of this.itemsRendered.toArray().entries()) { accWidth += el.nativeElement.getBoundingClientRect().width @@ -79,7 +79,7 @@ export class ListOverflowComponent implements AfterV e.style.visibility = shouldBeVisible ? 'inherit' : 'hidden' } - logger('Accumulated children width is %d so exclude index is %d', accWidth, showItemsUntilIndexExcluded) + debugLogger('Accumulated children width is %d so exclude index is %d', accWidth, showItemsUntilIndexExcluded) this.showItemsUntilIndexExcluded = showItemsUntilIndexExcluded this.cdr.markForCheck() diff --git a/client/src/app/shared/shared-main/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts index a2367166e..bf8870a79 100644 --- a/client/src/app/shared/shared-main/users/user-notification.model.ts +++ b/client/src/app/shared/shared-main/users/user-notification.model.ts @@ -2,6 +2,7 @@ import { AuthUser } from '@app/core' import { Account } from '@app/shared/shared-main/account/account.model' import { Actor } from '@app/shared/shared-main/account/actor.model' import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model' +import { logger } from '@root-helpers/logger' import { AbuseState, ActorInfo, @@ -234,7 +235,7 @@ export class UserNotification implements UserNotificationServer { } } catch (err) { this.type = null - console.error(err) + logger.error(err) } } -- cgit v1.2.3