Skip to content

Commit

Permalink
refactor: disable logging in integration environment (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Oct 28, 2024
1 parent 627980d commit 6059f13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@
"webpack-merge": "^5.9.0"
},
"scripts": {
"build:dev": "cross-env sdkEnv=sandbox webpack --config webpack.dev.js",
"build:dev-integ": "cross-env sdkEnv=integ webpack --config webpack.dev.js",
"start": "cross-env sdkEnv=local webpack serve --config webpack.dev.js",
"build:prod": "cross-env sdkEnv=prod webpack --config webpack.common.js",
"build": "webpack --config webpack.common.js",
"build:sandbox": "cross-env sdkEnv=sandbox webpack --config webpack.common.js",
"build:integ": "cross-env sdkEnv=integ webpack --config webpack.common.js",
"test": "cd cypress-tests && npm run cypress:run",
"build:integ": "cross-env sdkEnv=integ enableLogging=false webpack --config webpack.common.js",
"build:playground": "npm run setup:playground && npm run build",
"build:prod": "cross-env sdkEnv=prod enableLogging=true webpack --config webpack.common.js",
"build:sandbox": "cross-env sdkEnv=sandbox enableLogging=true webpack --config webpack.common.js",
"deploy-to-s3": "node ./scripts/pushToS3.js",
"postinstall": "cd Hyperswitch-React-Demo-App && npm i",
"prepare": "husky install",
"re:build": "rescript",
"re:clean": "rescript clean",
"re:start": "rescript -w",
"re:format": "rescript format -all",
"start:playground": "npm run postinstall && cd Hyperswitch-React-Demo-App && node promptScript.js && npm run start",
"build:playground": "npm run postinstall && cd Hyperswitch-React-Demo-App && node promptScript.js && npm run build",
"prepare": "husky install",
"deploy-to-s3": "node ./scripts/pushToS3.js",
"postinstall": "cd Hyperswitch-React-Demo-App && npm i",
"re:start": "rescript -w",
"setup:playground": "npm run postinstall && cd Hyperswitch-React-Demo-App && node promptScript.js",
"start": "cross-env sdkEnv=local enableLogging=false webpack serve --config webpack.dev.js",
"start:playground": "npm run setup:playground && npm run start",
"test": "cd cypress-tests && npm run cypress:run",
"test:hooks": "npx eslint src/"
},
"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const getEnvVariable = (variable, defaultValue) =>
process.env[variable] ?? defaultValue;

const sdkEnv = getEnvVariable("sdkEnv", "local");
const enableLogging = getEnvVariable("enableLogging", "false") === "true";
const envSdkUrl = getEnvVariable("ENV_SDK_URL", "");
const envBackendUrl = getEnvVariable("ENV_BACKEND_URL", "");
const envLoggingUrl = getEnvVariable("ENV_LOGGING_URL", "");
Expand Down Expand Up @@ -60,7 +61,6 @@ const confirmEndPoint =
const logEndpoint =
envLoggingUrl || `https://${logDomain}.hyperswitch.io/logs/sdk`;

const enableLogging = true;
const loggingLevel = "DEBUG";
const maxLogsPushedPerEventName = 100;

Expand All @@ -84,7 +84,7 @@ module.exports = (publicPath = "auto") => {
logEndpoint: JSON.stringify(logEndpoint),
sentryDSN: JSON.stringify(process.env.SENTRY_DSN),
sentryScriptUrl: JSON.stringify(process.env.SENTRY_SCRIPT_URL),
enableLogging: JSON.stringify(enableLogging),
enableLogging: enableLogging,
loggingLevel: JSON.stringify(loggingLevel),
maxLogsPushedPerEventName: JSON.stringify(maxLogsPushedPerEventName),
}),
Expand Down

0 comments on commit 6059f13

Please sign in to comment.