Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Privacy Center debug logging to development-only #3638

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions clients/privacy-center/app/server-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ const loadConfigFile = async (
path = urlString.replace("file:", "");
}
const file = await fsPromises.readFile(path || url, "utf-8");
console.log(`Loaded configuration file: ${urlString}`);
if (process.env.NODE_ENV === "development") {
console.log(`Loaded configuration file: ${urlString}`);
}
return file;
} catch (err: any) {
// Catch "file not found" errors (ENOENT)
Expand Down Expand Up @@ -237,7 +239,9 @@ export const loadPrivacyCenterEnvironment =
);
}
// DEFER: Log a version number here (see https://github.com/ethyca/fides/issues/3171)
console.log("Load Privacy Center environment for session...");
if (process.env.NODE_ENV === "development") {
console.log("Load Privacy Center environment for session...");
}

// Load environment variables
const settings: PrivacyCenterSettings = {
Expand Down