From c3e11bfb90991893b7f0bfea6f095079ca40a70a Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 12 Mar 2023 11:42:41 +0100 Subject: [PATCH] Adding debug log to diagnostics #632 --- .../model/diagnostics/ConfigDiagnostics.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/backend/model/diagnostics/ConfigDiagnostics.ts b/src/backend/model/diagnostics/ConfigDiagnostics.ts index 799dd09b..be3079c7 100644 --- a/src/backend/model/diagnostics/ConfigDiagnostics.ts +++ b/src/backend/model/diagnostics/ConfigDiagnostics.ts @@ -34,6 +34,7 @@ export class ConfigDiagnostics { albumConfig: ClientAlbumConfig, original: PrivateConfigClass ): void { + Logger.debug(LOG_TAG, 'Testing album config'); // nothing to check } @@ -52,6 +53,7 @@ export class ConfigDiagnostics { static async testDatabase( databaseConfig: ServerDataBaseConfig ): Promise { + Logger.debug(LOG_TAG, 'Testing database config'); await SQLConnection.tryConnection(databaseConfig); if (databaseConfig.type === DatabaseType.sqlite) { try { @@ -71,6 +73,7 @@ export class ConfigDiagnostics { metaFileConfig: ClientMetaFileConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing meta file config'); if (metaFileConfig.gpx === true && config.Map.enabled === false) { throw new Error('*.gpx meta files are not supported without MAP'); } @@ -78,6 +81,7 @@ export class ConfigDiagnostics { static testVideoConfig(videoConfig: ServerVideoConfig, config: PrivateConfigClass): Promise { + Logger.debug(LOG_TAG, 'Testing video config with ffmpeg test'); return new Promise((resolve, reject) => { try { @@ -120,16 +124,19 @@ export class ConfigDiagnostics { static async testSharp(): Promise { + Logger.debug(LOG_TAG, 'Testing sharp package'); // eslint-disable-next-line @typescript-eslint/no-var-requires const sharp = require('sharp'); sharp(); } static async testTempFolder(folder: string): Promise { + Logger.debug(LOG_TAG, 'Testing temp folder'); await this.checkReadWritePermission(folder); } static testImageFolder(folder: string): Promise { + Logger.debug(LOG_TAG, 'Testing images folder'); return new Promise((resolve, reject) => { if (!fs.existsSync(folder)) { reject('Images folder not exists: \'' + folder + '\''); @@ -150,6 +157,7 @@ export class ConfigDiagnostics { static async testThumbnailConfig( thumbnailConfig: ServerThumbnailConfig ): Promise { + Logger.debug(LOG_TAG, 'Testing thumbnail config'); if (thumbnailConfig.personFaceMargin < 0 || thumbnailConfig.personFaceMargin > 1) { @@ -176,6 +184,7 @@ export class ConfigDiagnostics { task: ServerJobConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing tasks config'); return; } @@ -183,6 +192,7 @@ export class ConfigDiagnostics { faces: ClientFacesConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing faces config'); if (faces.enabled === true) { if (config.Search.enabled === false) { throw new Error('Faces support needs enabled search'); @@ -194,6 +204,7 @@ export class ConfigDiagnostics { search: ClientSearchConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing search config'); //nothing to check } @@ -201,6 +212,7 @@ export class ConfigDiagnostics { sharing: ClientSharingConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing sharing config'); if ( sharing.enabled === true && config.Users.authenticationRequired === false @@ -213,10 +225,12 @@ export class ConfigDiagnostics { sharing: ClientRandomPhotoConfig, config: PrivateConfigClass ): Promise { + Logger.debug(LOG_TAG, 'Testing random photo config'); //nothing to check } static async testMapConfig(map: ClientMapConfig): Promise { + Logger.debug(LOG_TAG, 'Testing map config'); if (map.enabled === false) { return; } @@ -242,6 +256,7 @@ export class ConfigDiagnostics { } static async testPreviewConfig(settings: ServerPreviewConfig): Promise { + Logger.debug(LOG_TAG, 'Testing preview config'); const sp = new SearchQueryParser(); if ( !Utils.equalsFilter(