From 85bfd82f25397edb336d4cc62595560a8173952f Mon Sep 17 00:00:00 2001 From: Ilianna Papastefanou Date: Thu, 6 Oct 2022 15:06:36 +0100 Subject: [PATCH] chore: Add debug log for local bundle --- src/lib/iac/test/v2/local-cache/rules-bundle/download.ts | 5 +++++ src/lib/iac/test/v2/local-cache/rules-bundle/index.ts | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/iac/test/v2/local-cache/rules-bundle/download.ts b/src/lib/iac/test/v2/local-cache/rules-bundle/download.ts index ba546ca7f9..ccc8bea046 100644 --- a/src/lib/iac/test/v2/local-cache/rules-bundle/download.ts +++ b/src/lib/iac/test/v2/local-cache/rules-bundle/download.ts @@ -19,9 +19,14 @@ export async function downloadRulesBundle( // IAC_BUNDLE_PATH is a developer setting that is not useful to most users. It // is not a replacement for custom rules. if (config.IAC_BUNDLE_PATH) { + debugLog(`Located a local rules bundle at ${testConfig.iacCachePath}`); return config.IAC_BUNDLE_PATH; } + debugLog( + `Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`, + ); + let downloadDurationSeconds = 0; const timer = new TimerMetricInstance('iac_rules_bundle_download'); diff --git a/src/lib/iac/test/v2/local-cache/rules-bundle/index.ts b/src/lib/iac/test/v2/local-cache/rules-bundle/index.ts index f48e6b0938..02930702cb 100644 --- a/src/lib/iac/test/v2/local-cache/rules-bundle/index.ts +++ b/src/lib/iac/test/v2/local-cache/rules-bundle/index.ts @@ -1,17 +1,10 @@ -import * as createDebugLogger from 'debug'; - import { TestConfig } from '../../types'; import { downloadRulesBundle } from './download'; -const debugLogger = createDebugLogger('snyk-iac'); - export async function initRulesBundle(testConfig: TestConfig): Promise { // We are currently using the legacy rules bundle and we need to re-download it each time to use the latest one available. // debugLogger('Looking for rules bundle locally'); // let rulesBundlePath = await lookupLocalRulesBundle(testConfig); - debugLogger( - `Downloading the rules bundle and saving it at ${testConfig.iacCachePath}`, - ); return await downloadRulesBundle(testConfig); }