From 2fc022b32576f5339b6a789bc1ccc43e0d4cf66e Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 6 Jun 2024 16:51:08 +0900 Subject: [PATCH] chore: remove log statement --- src/core/aws-web.core.ts | 11 ++++------- src/core/azure-web.core.ts | 7 +++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/core/aws-web.core.ts b/src/core/aws-web.core.ts index 185b1cd..c77c0c3 100644 --- a/src/core/aws-web.core.ts +++ b/src/core/aws-web.core.ts @@ -18,7 +18,6 @@ export class AWSWebCore implements WebCoreService { */ constructor(private readonly config: WebCoreConfig<'aws'>) { this.logger = new LoggerService('AWSCore'); - this.logger.log('init AWSCore'); this.tokenStorage = new AWSStorageService(this.config); } @@ -31,34 +30,32 @@ export class AWSWebCore implements WebCoreService { * @throws {Error} - Throws an error if there is no cached token. */ async init(): Promise { - this.logger.log('initilze AWSWebCore'); const hasCachedToken = await this.tokenStorage.hasCachedToken(); if (!hasCachedToken) { - this.logger.warn('has no token!'); + this.logger.warn('initialized without token!'); return 'no-token'; } const shouldRefreshToken = await this.tokenStorage.shouldRefreshToken(); if (shouldRefreshToken) { - this.logger.info('should refresh token!'); const refreshed = await this.refreshCachedToken(); if (refreshed) { await this.getCurrentCredentials(); - this.logger.info('refreshed token'); + this.logger.info('initialized and refreshed token!'); return 'refreshed'; } } const cachedToken = await this.tokenStorage.hasCachedToken(); if (!cachedToken) { - this.logger.warn('has no token!'); + this.logger.warn('initialized without token!'); return 'no-token'; } // build AWS credential without refresh const credential = await this.tokenStorage.getCachedCredentials(); this.createAWSCredentials(credential); - this.logger.info('build credentials'); + this.logger.info('initialized with token!'); return 'build'; } diff --git a/src/core/azure-web.core.ts b/src/core/azure-web.core.ts index c677cec..2da0f4e 100644 --- a/src/core/azure-web.core.ts +++ b/src/core/azure-web.core.ts @@ -18,7 +18,6 @@ export class AzureWebCore implements WebCoreService { */ constructor(private readonly config: WebCoreConfig<'azure'>) { this.logger = new LoggerService('AzureCore'); - this.logger.log('init AzureCore'); this.tokenStorage = new AzureStorageService(this.config); } @@ -27,18 +26,18 @@ export class AzureWebCore implements WebCoreService { * @returns {Promise} - The state of the Azure web core after initialization. */ async init(): Promise { - this.logger.log('initialize AzureCore'); const hasCachedToken = await this.tokenStorage.hasCachedToken(); if (!hasCachedToken) { - this.logger.warn('has no token!'); + this.logger.warn('initialized without token!'); return 'no-token'; } const shouldRefreshToken = await this.tokenStorage.shouldRefreshToken(); if (shouldRefreshToken) { - this.logger.info('should refresh token!'); + this.logger.info('initialized and refreshed token!'); // TODO: refresh azure token } + this.logger.info('initialized with token!'); return 'has-token'; }