diff --git a/src/client/jiraClient.ts b/src/client/jiraClient.ts index 9fef2ed..1956669 100644 --- a/src/client/jiraClient.ts +++ b/src/client/jiraClient.ts @@ -134,9 +134,9 @@ async function preFetchImage(account: IJiraIssueAccountSettings, url: string): P let response: RequestUrlResponse try { response = await requestUrl(options) - SettingsData.logRequestsResponses && console.info('JiraIssue:FetchImage:', { request: options, response }) + SettingsData.logImagesFetch && console.info('JiraIssue:FetchImage:', { request: options, response }) } catch (errorResponse) { - SettingsData.logRequestsResponses && console.warn('JiraIssue:FetchImage:', { request: options, response: errorResponse }) + SettingsData.logImagesFetch && console.warn('JiraIssue:FetchImage:', { request: options, response: errorResponse }) response = errorResponse } diff --git a/src/interfaces/settingsInterfaces.ts b/src/interfaces/settingsInterfaces.ts index ec669e7..dd9aa08 100644 --- a/src/interfaces/settingsInterfaces.ts +++ b/src/interfaces/settingsInterfaces.ts @@ -34,6 +34,7 @@ export interface IJiraIssueSettings { inlineIssuePrefix: string searchColumns: ISearchColumn[] logRequestsResponses: boolean + logImagesFetch: boolean showColorBand: boolean // Legacy credentials diff --git a/src/settings.ts b/src/settings.ts index 418d333..7183f53 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -35,6 +35,7 @@ export const DEFAULT_SETTINGS: IJiraIssueSettings = { { type: ESearchColumnsTypes.STATUS, compact: false }, ], logRequestsResponses: false, + logImagesFetch: false, } export const DEFAULT_ACCOUNT: IJiraIssueAccountSettings = { @@ -593,7 +594,7 @@ export class JiraIssueSettingTab extends PluginSettingTab { containerEl.createEl('h3', { text: 'Troubleshooting' }) new Setting(containerEl) - .setName('Log Request and Responses') + .setName('Log data request and responses') .setDesc('Log in the console (CTRL+Shift+I) all the API requests and responses performed by the plugin.') .addToggle(toggle => toggle .setValue(SettingsData.logRequestsResponses) @@ -601,6 +602,15 @@ export class JiraIssueSettingTab extends PluginSettingTab { SettingsData.logRequestsResponses = value await this.saveSettings() })) + new Setting(containerEl) + .setName('Log images requests and responses') + .setDesc('Log in the console (CTRL+Shift+I) all the images fetch requests and responses performed by the plugin.') + .addToggle(toggle => toggle + .setValue(SettingsData.logImagesFetch) + .onChange(async value => { + SettingsData.logImagesFetch = value + await this.saveSettings() + })) } createNewEmptyAccount() {