Log feature flags on separate lines in debug mode

This prevents them from being truncated.
This commit is contained in:
Henry Mercer 2024-05-09 11:52:20 +01:00
parent c49579ba44
commit 9dc84e9abe
3 changed files with 12 additions and 6 deletions

6
lib/feature-flags.js generated
View file

@ -332,8 +332,10 @@ class GitHubFeatureFlags {
features: featuresToRequest, features: featuresToRequest,
}); });
const remoteFlags = response.data; const remoteFlags = response.data;
this.logger.debug("Loaded the following default values for the feature flags from the Code Scanning API: " + this.logger.debug("Loaded the following default values for the feature flags from the Code Scanning API:");
`${JSON.stringify(remoteFlags)}`); for (const [feature, value] of Object.entries(remoteFlags).sort(([nameA], [nameB]) => nameA.localeCompare(nameB))) {
this.logger.debug(` ${feature}: ${value}`);
}
this.hasAccessedRemoteFeatureFlags = true; this.hasAccessedRemoteFeatureFlags = true;
return remoteFlags; return remoteFlags;
} }

File diff suppressed because one or more lines are too long

View file

@ -477,11 +477,15 @@ class GitHubFeatureFlags {
features: featuresToRequest, features: featuresToRequest,
}, },
); );
const remoteFlags = response.data; const remoteFlags = response.data as GitHubFeatureFlagsApiResponse;
this.logger.debug( this.logger.debug(
"Loaded the following default values for the feature flags from the Code Scanning API: " + "Loaded the following default values for the feature flags from the Code Scanning API:",
`${JSON.stringify(remoteFlags)}`,
); );
for (const [feature, value] of Object.entries(remoteFlags).sort(
([nameA], [nameB]) => nameA.localeCompare(nameB),
)) {
this.logger.debug(` ${feature}: ${value}`);
}
this.hasAccessedRemoteFeatureFlags = true; this.hasAccessedRemoteFeatureFlags = true;
return remoteFlags; return remoteFlags;
} catch (e) { } catch (e) {