From 3cd1d0fec4392509f1ef18f00e3c372600565f52 Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 24 Jun 2025 16:54:21 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A0=81=EC=84=A4o=20=ED=94=BC=EC=BD=94?= =?UTF-8?q?=EC=BB=A4=20x=20=EC=99=80=20=EC=A0=81=EC=84=A4x=20=ED=94=BC?= =?UTF-8?q?=EC=BD=94=EC=BB=A4=20o=20=EC=84=9C=EB=A1=9C=20=EB=B0=94?= =?UTF-8?q?=EB=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/simulator/Simulator.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/simulator/Simulator.jsx b/src/components/simulator/Simulator.jsx index 94307e8d..43beffbb 100644 --- a/src/components/simulator/Simulator.jsx +++ b/src/components/simulator/Simulator.jsx @@ -193,10 +193,10 @@ export default function Simulator() { setChartData(hatsudenryouAll) break case 'B': - setChartData(hatsudenryouAllSnow) + setChartData(hatsudenryouPeakcutAll) break case 'C': - setChartData(hatsudenryouPeakcutAll) + setChartData(hatsudenryouAllSnow) break case 'D': setChartData(hatsudenryouPeakcutAllSnow) From 9da2a7166839596e09ecae22c2e7e5d920eedff6 Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 24 Jun 2025 17:49:54 +0900 Subject: [PATCH 2/2] =?UTF-8?q?logging=20=EC=84=A4=EC=A0=95=20logger.log('?= =?UTF-8?q?a',=20a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 ++++- .env.production | 5 ++++- src/util/logger.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/util/logger.js diff --git a/.env.development b/.env.development index 87c2ba14..46694e6d 100644 --- a/.env.development +++ b/.env.development @@ -29,4 +29,7 @@ AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" -S3_PROFILE="dev" \ No newline at end of file +S3_PROFILE="dev" + +#logging +NEXT_PUBLIC_ENABLE_LOGGING=true \ No newline at end of file diff --git a/.env.production b/.env.production index bb3dfbf0..50728524 100644 --- a/.env.production +++ b/.env.production @@ -30,4 +30,7 @@ AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" -S3_PROFILE="prd" \ No newline at end of file +S3_PROFILE="prd" + +#logging +NEXT_PUBLIC_ENABLE_LOGGING=false \ No newline at end of file diff --git a/src/util/logger.js b/src/util/logger.js new file mode 100644 index 00000000..95e783f4 --- /dev/null +++ b/src/util/logger.js @@ -0,0 +1,30 @@ +// utils/logger.js +const isLoggingEnabled = process.env.NEXT_PUBLIC_ENABLE_LOGGING === 'true'; + +export const logger = { + log: (...args) => { + if (isLoggingEnabled) { + console.log(...args); + } + }, + error: (...args) => { + // 에러는 항상 로깅하거나, 또는 환경에 따라 다르게 처리 + console.error(...args); + // 운영 환경에서는 서버로 에러를 보내는 코드를 추가할 수도 있음 + }, + warn: (...args) => { + if (isLoggingEnabled) { + console.warn(...args); + } + }, + info: (...args) => { + if (isLoggingEnabled) { + console.info(...args); + } + }, + debug: (...args) => { + if (isLoggingEnabled) { + console.debug(...args); + } + } +}; \ No newline at end of file