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
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The types of changes are:

- Removed `pyodbc` in favor of `pymssql` for handling SQL Server connections [#3435](https://github.com/ethyca/fides/pull/3435)
- Only create a PrivacyRequest when saving consent if at least one notice has system-wide enforcement [#3626](https://github.com/ethyca/fides/pull/3626)

### Fixed

- Fix race condition with consent modal link rendering [#3521](https://github.com/ethyca/fides/pull/3521)
Expand All @@ -39,6 +40,7 @@ The types of changes are:
- Only create default experience configs on startup, not update [#3605](https://github.com/ethyca/fides/pull/3605)
- Update to latest asyncpg dependency to avoid build error [#3614](https://github.com/ethyca/fides/pull/3614)
- Fix bug where editing a data use on a system could delete existing data uses [#3627](https://github.com/ethyca/fides/pull/3627)
- Restrict Privacy Center debug logging to development-only [#3638](https://github.com/ethyca/fides/pull/3638)

### Developer Experience

Expand Down
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