Skip to content

fix: 릴리즈 빌드에서 console 로깅과 DevTools 제거 - #215

Merged
JioCoder merged 3 commits into
mainfrom
feat/production-console-strip
Sep 7, 2026
Merged

JioCoder merged 3 commits into
mainfrom
feat/production-console-strip

Conversation

@howooyeon

Copy link
Copy Markdown
Contributor

관련 이슈

없음. #213 위에 쌓은 PR이라 베이스가 feat/tracking-path-downsampling입니다. 테스트 환경(jest-expo)이 #213에 들어 있어서 그 위에 올렸고, #213이 머지되면 베이스를 main으로 바꾸겠습니다. 코드상 겹치는 파일은 없습니다.

작업 내용

릴리즈 빌드에 console.* 호출 74개가 그대로 실려 있었습니다. Hermes에서 console.*은 동기 호출이라, 트래킹처럼 초당 여러 번 도는 경로에서는 비용이 그대로 드러납니다. 소켓 메시지 수신 로그, publishGps 경고, 푸시 포어그라운드 수신 로그가 모두 여기 해당합니다.

babel.config.jsenv.production으로 transform-remove-console을 걸었습니다. console.errorconsole.warn은 남깁니다. Sentry로 올라가는 경로와 실제 장애 진단에 필요한 로그라 지우지 않았습니다.

STOMP 클라이언트의 debug 콜백은 송수신 프레임 전체를 문자열로 받습니다. GPS publish까지 포함되므로 개발 빌드에서만 로깅하도록 바꿨습니다.

React Query DevTools 훅이 프로덕션에서도 실행되고 있었습니다. 개발 빌드에서만 마운트되는 컴포넌트로 옮겼습니다.

이 세 가지는 예전에 fix/production-logging 브랜치(92efc86)에서 이미 작업된 내용인데 머지되지 않은 채 origin/main 대비 94커밋 뒤처져 있었습니다. 그 브랜치의 접근을 현재 main에 맞춰 다시 적용했습니다.

확인 방법

npm test__tests__/babel-config.test.js가 통과하는지 봐주세요. 실제 babel.config.jsenvName: "production"으로 돌려서 console.log가 사라지고 console.warnconsole.error는 남는지 검증합니다.

릴리즈 빌드에서는 트래킹을 시작했을 때 Xcode 콘솔이나 logcat에 [STOMP], [Push], [Tracking] 로그가 찍히지 않아야 합니다. 개발 빌드에서는 종전대로 다 보여야 합니다.

리뷰 포인트

원래 브랜치(92efc86)에는 Sentry tracesSampleRate를 1.0에서 0.2로 낮추는 변경도 함께 있었습니다. 계측 오버헤드와 쿼터에 영향이 있어서 성능과 무관하지 않지만, 관측성을 줄이는 결정이라 이 PR에서는 빼뒀습니다. 필요하면 별도로 올리겠습니다.

transform-remove-console은 호출 자체를 지우므로 인자 계산도 함께 사라집니다. Object.keys(...).join(",") 같은 인자를 넘기던 로그가 몇 군데 있어서 그 계산도 릴리즈에서는 없어집니다. 의도한 동작입니다.

STOMP debug를 no-op으로 바꿔도 stompjs가 프레임 문자열을 만들어 콜백에 넘기는 것 자체는 막지 못합니다. 라이브러리를 건드리지 않고 줄일 수 있는 선은 여기까지입니다.

.js 테스트 파일에서 jest 전역이 no-undef로 잡혀서 eslint.config.js에 테스트 파일용 전역 설정을 추가했습니다.

체크리스트

  • 스타일을 className(NativeWind)으로 작성했고, 토큰에 있는 값을 하드코딩하지 않았습니다
  • 그림자는 boxShadow를 사용했습니다 (shadow* / elevation 미사용)
  • 자동 생성 파일(tokens/**, tokens.cjs, typography-plugin.cjs, css/variables.css, css/typography.css)을 직접 수정하지 않았습니다
  • iOS / Android 중 최소 한 쪽에서 실제로 동작을 확인했습니다 — 릴리즈 빌드를 못 돌려봤습니다. babel 변환 결과는 테스트로 검증했지만 실제 빌드 확인이 필요합니다
  • API 스펙 변경이 있다면 npm run typegen 결과를 반영했거나, 반영하지 않은 이유를 적었습니다 — 스펙 변경 없음

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 959fc418-e805-4a87-8ce9-285df981dbf1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from feat/tracking-path-downsampling to main September 7, 2026 04:11
@JioCoder
JioCoder merged commit 0c4cf36 into main Sep 7, 2026
3 checks passed
@JioCoder
JioCoder deleted the feat/production-console-strip branch September 7, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants