Skip to content

[Refactor] 로그제거#263

Merged
librawish808 merged 7 commits intodevelopfrom
refactor/Log.d-Naiper-Kermit-#262
Feb 15, 2026
Merged

[Refactor] 로그제거#263
librawish808 merged 7 commits intodevelopfrom
refactor/Log.d-Naiper-Kermit-#262

Conversation

@librawish808
Copy link
Copy Markdown
Collaborator

@librawish808 librawish808 commented Feb 13, 2026

🔗 관련 이슈

📙 작업 설명

  • 로그 제거 후 린트 검사에 통과되지 않은 부분을 수정했습니다

💬 추가 설명 or 리뷰 포인트 (선택)

Summary by CodeRabbit

  • Chores
    • 애플리케이션 전반에서 디버그/오류 로그 출력 및 관련 임포트를 제거해 런타임 콘솔 출력이 사라졌습니다. UI·동작·공개 API에는 변경이 없고 기존 흐름·오류 처리는 유지됩니다.
    • 일부 예외 처리에서 로그 출력이 제거되어 실패 시 출력이 생략(무시)되는 경우가 있습니다.
    • 내부 캐치 변수명 정리(ignored → e) 및 detekt 설정(빈 캐치/예외 규칙) 조정이 포함되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

앱 전반(~40개 파일)에서 android.util.Log 임포트와 Log.* 호출을 제거하고, 예외/실패 경로의 로그 출력을 삭제한 리팩토링입니다. 제어 흐름과 공개 API, 동작은 변경되지 않았습니다.

Changes

Cohort / File(s) Summary
App & FCM
app/src/main/java/com/konkuk/medicarecall/App.kt, app/src/main/java/.../data/api/fcm/FcmService.kt, app/src/main/java/.../data/di/NetworkModule.kt
FCM 토큰 처리 및 네트워크 토큰 갱신 경로에서 Log 임포트 및 로그 호출 제거. 실패/예외 경로는 더 이상 로그를 남기지 않음.
Serializers & Mappers
app/src/main/java/.../data/mapper/SleepMapper.kt, app/src/main/java/.../data/util/ElderIdsSerializer.kt, app/src/main/java/.../data/util/TokenSerializer.kt
직렬화·매퍼의 예외 처리부에서 로그 삭제 — 실패 시 기존대로 기본값/폴백을 반환하되 로그가 없음.
Repositories
app/src/main/java/.../data/repositoryimpl/EldersHealthInfoRepositoryImpl.kt, app/src/main/java/.../data/repositoryimpl/FcmRepositoryImpl.kt, app/src/main/java/.../data/repositoryimpl/SetCallRepositoryImpl.kt
캐시/토큰 갱신 등 내부 디버그·에러 로그 제거. 비즈니스 로직과 에러 처리 흐름은 유지됨.
Domain Usecase
app/src/main/java/.../domain/usecase/CheckLoginStatusUseCase.kt
예외 및 분기 경로의 로그 호출 제거 — 반환 동작과 로직은 동일.
UI 컴포넌트·확장·유틸
app/src/main/java/.../ui/common/component/IllnessInfoItem.kt, .../SpecialNoteItem.kt, .../extension/NavBackStackEntryExt.kt, .../util/Extensions.kt, .../statistics/WeeklyHealthCard.kt
컴포저블·확장·유틸에서 디버그·에러 로그 삭제. 렌더링·동작에 영향 없음.
Home·Detail Features
app/src/main/java/.../ui/feature/home/viewmodel/HomeViewModel.kt, .../homedetail/.../GlucoseDetailScreen.kt, .../GlucoseViewModel.kt, .../medicine/MedicineDetailScreen.kt, .../sleep/SleepViewModel.kt
데이터 로드·상태 업데이트 경로의 로그 제거. 에러 처리와 폴백 로직은 유지됨.
Login 흐름 (콜타임·회원등록 등)
app/src/main/java/.../ui/feature/login/.../*.kt
콜타임 피커, 전화번호/회원등록, elder 등록 관련 로그 삭제. 예외/콜백 흐름은 동일함.
Settings — Screens & ViewModels
app/src/main/java/.../ui/feature/settings/.../screen/*.kt, .../viewmodel/*.kt
다수의 설정 화면 및 뷰모델에서 성공·실패 로그 제거. 상태 업데이트·에러 흐름 변경 없음.
기타 UI/뷰모델
여러 컴포넌트 및 뷰모델 파일 (다수)
프로젝트 전반에서 android.util.Log 임포트 및 로그 호출을 삭제 — 기능적 변경 없이 로깅 사이드이펙트만 제거됨.
Static Analysis
detekt-config.yml
EmptyCatchBlock 등 일부 규칙을 비활성화/확장 — swallowed-exception 관련 규칙 추가 및 비활성화.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

refactor

Suggested reviewers

  • ProtossManse
  • alswlekk

Poem

로그가 사라진 조용한 밤,
코드만 남아 가벼워졌네.
콘솔은 쉼표 하나 찍고,
빌드는 담담히 앞으로 간다. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 로그 제거라는 주요 변경 사항을 정확하게 요약하고 있으며, 링크된 이슈 #262의 목표와 완벽하게 일치합니다.
Linked Issues check ✅ Passed PR은 이슈 #262의 모든 코딩 요구사항을 충족합니다: 39개 파일에서 Android Log.d/Log.e 로그 제거 완료 및 Detekt 린트 규칙 설정으로 성능 개선을 실현했습니다.
Out of Scope Changes check ✅ Passed PR의 모든 변경사항은 로그 제거 목표에 부합합니다. Detekt 설정 변경과 catch 변수명 변경도 로그 제거와 관련된 린트 이슈 해결을 위한 것입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/Log.d-Naiper-Kermit-#262
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch refactor/Log.d-Naiper-Kermit-#262
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/konkuk/medicarecall/data/api/fcm/FcmService.kt (1)

131-133: ⚠️ Potential issue | 🟡 Minor

파이프라인 실패: 닫는 중괄호 앞 빈 줄 제거 필요

detekt에서 NoBlankLineBeforeRbrace 위반이 보고되고 있어요. Line 132의 빈 줄을 제거하면 CI가 통과됩니다.

🔧 수정 제안
         }
     }
-
 }
🧹 Nitpick comments (6)
app/src/main/java/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt (2)

62-65: TAG 상수가 더 이상 사용되지 않습니다.

Log.e/Log.d 호출이 모두 제거되면서 TAG 상수가 dead code가 되었습니다. 함께 제거해 주세요.

♻️ 수정 제안
 private companion object {
-    const val TAG = "HomeViewModel"
     const val KEY_SELECTED_ELDER_ID = "selectedElderId"
 }

157-159: 사용되지 않는 error 파라미터를 _로 변경하는 것을 권장합니다.

Log.e 제거 후 error가 더 이상 참조되지 않으므로, Kotlin 컨벤션에 맞게 _로 바꾸면 깔끔합니다.

♻️ 수정 제안
-                .onFailure { error ->
+                .onFailure { _ ->
app/src/main/java/com/konkuk/medicarecall/ui/feature/login/myinfo/viewmodel/LoginInfoViewModel.kt (1)

88-89: 빈 콜백 블록 — 에러 처리 부재 확인 필요

로그 제거 후 onSuccessonFailure가 모두 빈 블록으로 남아 있습니다. 인증번호 요청 실패 시 사용자에게 아무런 피드백이 없는 상태인데, 이전에도 로그만 찍고 있었으니 이 PR의 범위는 아니지만, 향후 실패 시 사용자에게 토스트나 이벤트를 emit하는 처리를 추가하면 좋을 것 같습니다.

app/src/main/java/com/konkuk/medicarecall/domain/usecase/CheckLoginStatusUseCase.kt (2)

38-38: .onSuccess { } 블록 제거 가능

로그 제거 후 .onSuccess { } 가 no-op으로 남아있어요. 없어도 동작에 영향 없으니 깔끔하게 제거해도 좋을 것 같습니다.

♻️ 제안
             eldersInfoRepository.getCareCallTimes(it.key)
-                    .onSuccess { }
                     .onFailure { exception ->

42-43: errorBody 변수가 사용되지 않고 남아있습니다

로그 출력에서만 사용되던 errorBody가 제거 후 dead code로 남아있네요. 린트 경고 대상이 될 수 있습니다.

♻️ 제안
                            is HttpException -> {
                                val code = exception.code()
-                                val errorBody = exception.response()?.errorBody()?.toString()

                                when (code) {
app/src/main/java/com/konkuk/medicarecall/data/repositoryimpl/FcmRepositoryImpl.kt (1)

55-63: onSuccess/onFailure 체인 제거 가능

로그 제거 후 response.onSuccess { }.onFailure { } 가 아무 일도 하지 않습니다. response 변수 할당과 함께 정리하면 코드가 더 깔끔해집니다.

♻️ 제안
             // 서버에 갱신 요청
-            val response: Result<Unit> = runCatching {
+            runCatching {
                 fcmUpdateService.updateFcmToken(
                     header = "Bearer $jwtToken",
                     body = mapOf("fcmToken" to newToken),
                 )
             }
-            response.onSuccess {
-            }.onFailure {
-            }

Copy link
Copy Markdown
Contributor

@ikseong00 ikseong00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

(fcmRepository as? FcmRepositoryImpl)?.validateAndRefreshTokenIfNeeded(jwtToken)
} catch (e: Exception) {
Log.e(TAG, "새 FCM 토큰 저장 중 오류 발생", e)
} catch (ignored: Exception) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ingored 보다는 형식에 맞춰 e 로 유지하면 좋을 것 같아요

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 반영했습니다!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/FirstTimeWheelPicker.kt`:
- Around line 94-95: In FirstTimeWheelPicker.kt inside the FirstTimeWheelPicker
class there are six empty catch blocks causing Detekt EmptyCatchBlock failures;
for each empty catch (the ones already noted in your review) add the same
explanatory comment inside the block (for example: // 리플렉션 실패 시 무시) so the catch
blocks are no longer empty—update all six occurrences accordingly.

In
`@app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/ThirdWheelPicker.kt`:
- Around line 88-89: In ThirdWheelPicker
(app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/ThirdWheelPicker.kt)
replace the six empty catch block exception parameters currently named "e" with
the Kotlin unused-parameter underscore "_" (i.e., change catch (e: Exception) to
catch (_: Exception)) for the occurrences at the six empty catch blocks so
Detekt's EmptyCatchBlock exemption resumes and CI passes.
🧹 Nitpick comments (4)
app/src/main/java/com/konkuk/medicarecall/App.kt (1)

87-91: 빈 catch 블록 — 향후 멀티플랫폼 로거 도입 시 복원 고려

Log.d 제거 취지는 이해하지만, 예외를 완전히 무시하면 FCM 토큰 저장 실패 시 프로덕션에서 원인 파악이 어려울 수 있어요. 브랜치명에 Napier/Kermit이 언급되어 있으니, 멀티플랫폼 로거 도입 시 이 부분에 로깅을 다시 추가하는 걸 추천드립니다. 🙂

♻️ 향후 로거 도입 시 예시
                 appScope.launch {
                     try {
                         fcmRepository.saveFcmToken(token)
                     } catch (e: Exception) {
-                        // FCM 토큰 저장 실패 무시
+                        // TODO: 멀티플랫폼 로거(Napier/Kermit) 도입 후 복원
+                        // logger.e("FCM 토큰 저장 실패", e)
                     }
                 }
app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/FirstTimeWheelPicker.kt (2)

78-96: hideDividers() 함수가 6번 복붙되어 있어요.

동일한 리플렉션 로직이 factoryupdate 블록마다 반복됩니다. NumberPicker 확장 함수로 한 번만 정의하면 파일 하단의 setPickerTextColor/setPickerTextStyle과 같은 패턴으로 깔끔하게 정리할 수 있습니다.

♻️ 확장 함수 추출 제안

파일 하단에 확장 함수를 추가하고:

`@SuppressLint`("DiscouragedPrivateApi", "SoonBlockedPrivateApi", "UseKtx")
fun NumberPicker.hideDividers() {
    try {
        val dividerField = NumberPicker::class.java
            .getDeclaredField("mSelectionDivider")
            .apply { isAccessible = true }
        dividerField.set(this, Color.TRANSPARENT.toDrawable())

        val heightField = NumberPicker::class.java
            .getDeclaredField("mSelectionDividerHeight")
            .apply { isAccessible = true }
        heightField.setInt(this, 0)
    } catch (e: Exception) {
        // 리플렉션 실패 시 무시
    }
}

그리고 기존 6곳의 인라인 hideDividers() 정의를 모두 hideDividers() 호출로 교체하면 됩니다.

Also applies to: 109-127, 160-178, 191-209, 251-269, 282-300


63-76: 주석 처리된 코드가 상당량 남아 있어요.

이 PR이 로그 제거 + 린트 정리 목적인데, 주석 처리된 코드 블록도 함께 정리하면 좋을 것 같아요. 나중에 필요하면 git history에서 복구할 수 있으니까요. 지금 당장 안 해도 괜찮지만 참고해주세요~ 🧹

Also applies to: 99-104, 129-136, 149-149, 152-158, 180-185, 211-218, 240-240, 243-249, 271-276, 302-309

app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/ThirdWheelPicker.kt (1)

72-90: hideDividers() 가 6회 중복 정의되어 있어요

동일한 리플렉션 로직이 factory/update 콜백마다 반복됩니다. NumberPicker의 확장 함수로 한 번만 정의하면 유지보수가 훨씬 편해집니다. 또한 파일 전반에 주석 처리된 코드가 상당량 남아 있는데, 필요 없다면 정리하는 것도 좋겠습니다.

`@SuppressLint`("DiscouragedPrivateApi", "SoonBlockedPrivateApi")
private fun NumberPicker.hideDividers() {
    try {
        val dividerField = NumberPicker::class.java
            .getDeclaredField("mSelectionDivider")
            .apply { isAccessible = true }
        dividerField.set(this, Color.TRANSPARENT.toDrawable())

        val heightField = NumberPicker::class.java
            .getDeclaredField("mSelectionDividerHeight")
            .apply { isAccessible = true }
        heightField.setInt(this, 0)
    } catch (_: Exception) {
    }
}

Also applies to: 103-121, 154-172, 185-203, 245-263, 276-294

Comment on lines +94 to 95
} catch (e: Exception) {
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Detekt EmptyCatchBlock 에러로 CI 파이프라인이 실패하고 있어요.

Lines 350, 382의 catch 블록에는 // 리플렉션 실패 시 무시 주석이 있어서 Detekt를 통과하지만, 이 6곳은 catch 블록이 완전히 비어 있어서 에러가 발생합니다. 동일하게 주석을 추가해주세요.

🔧 수정 제안

각 빈 catch 블록에 주석을 추가하면 됩니다. 예시 (Line 94-95):

-            } catch (e: Exception) {
-            }
+            } catch (e: Exception) {
+                // 리플렉션 실패 시 무시
+            }

나머지 5곳(Lines 125, 176, 207, 267, 298)도 동일하게 적용해주세요.

Also applies to: 125-126, 176-177, 207-208, 267-268, 298-299

🧰 Tools
🪛 GitHub Actions: Android CI

[error] 94-94: Detekt: EmptyCatchBlock detected. Empty catch block detected. If the exception can be safely ignored, name the exception according to the exemptions as per configuration.

🤖 Prompt for AI Agents
In
`@app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/FirstTimeWheelPicker.kt`
around lines 94 - 95, In FirstTimeWheelPicker.kt inside the FirstTimeWheelPicker
class there are six empty catch blocks causing Detekt EmptyCatchBlock failures;
for each empty catch (the ones already noted in your review) add the same
explanatory comment inside the block (for example: // 리플렉션 실패 시 무시) so the catch
blocks are no longer empty—update all six occurrences accordingly.

Comment on lines +88 to 89
} catch (e: Exception) {
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

ignorede 변경으로 Detekt EmptyCatchBlock 파이프라인 실패 발생

Detekt의 EmptyCatchBlock 규칙은 빈 catch 블록에서 예외 변수명이 설정된 면제 패턴(보통 ignored, expected 등)과 일치하면 허용합니다. 기존 ignored에서 e로 변경하면서 면제 조건이 깨져 CI가 실패하고 있습니다 (6곳 모두 동일).

수정 방법 (택 1):

  1. 변수명을 ignored로 되돌리기
  2. Kotlin 컨벤션에 맞게 _로 변경하기 (사용하지 않는 변수 표시)
🐛 제안: 모든 빈 catch 블록에서 변수명을 `_`로 변경
-                            } catch (e: Exception) {
+                            } catch (_: Exception) {
                             }

위 변경을 6곳 (Line 88, 119, 170, 201, 261, 292) 모두에 적용해 주세요.

Also applies to: 119-120, 170-171, 201-202, 261-262, 292-293

🧰 Tools
🪛 GitHub Actions: Android CI

[error] 88-88: Detekt: EmptyCatchBlock detected. Empty catch block detected. If the exception can be safely ignored, name the exception according to the exemptions as per configuration.

🤖 Prompt for AI Agents
In
`@app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/ThirdWheelPicker.kt`
around lines 88 - 89, In ThirdWheelPicker
(app/src/main/java/com/konkuk/medicarecall/ui/feature/login/calltime/component/ThirdWheelPicker.kt)
replace the six empty catch block exception parameters currently named "e" with
the Kotlin unused-parameter underscore "_" (i.e., change catch (e: Exception) to
catch (_: Exception)) for the occurrences at the six empty catch blocks so
Detekt's EmptyCatchBlock exemption resumes and CI passes.

- 빈 catch 블록 규칙 비활성화
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
detekt-config.yml (1)

73-83: ⚠️ Potential issue | 🟠 Major

EmptyCatchBlockSwallowedException를 전역적으로 비활성화하는 것은 위험할 수 있어요.

Log.d 제거 후 빈 catch 블록이 생긴 건 이해하지만, 이 규칙들을 프로젝트 전체에서 꺼버리면 앞으로 발생하는 모든 빈 catch 블록과 삼켜지는 예외가 감지되지 않습니다. 이건 잠재적인 버그를 숨길 수 있는 부분이에요.

브랜치 이름(refactor/Log.d-Naiper-Kermit-#262)에 Napier/Kermit이 언급되어 있는데, Log.d를 단순 삭제하기보다 멀티플랫폼 로거로 교체하는 게 원래 의도 아니었나요? 그렇게 하면 catch 블록이 비어있지 않게 되어 이 규칙들을 끌 필요도 없어질 거예요.

당장 로거 교체가 어렵다면, 최소한 아래 대안을 고려해 주세요:

  1. 개별 catch 블록에 @Suppress("EmptyCatchBlock") 어노테이션 적용 (전역 비활성화 대신)
  2. 빈 catch 블록에 의도적으로 무시하는 이유를 주석으로 남기기
  3. 향후 로거 교체 작업을 추적할 이슈 생성

Copy link
Copy Markdown
Collaborator

@alswlekk alswlekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ThiredWheelPicker 부분 파일만 한 번 더 확인 부탁드립니다 !

.apply { isAccessible = true }
heightField.setInt(this, 0)
} catch (ignored: Exception) {
} catch (e: Exception) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 이파일에서 전체적으로 Exception을 ignored에서 e로 바꾼 이유가 있을까요 ??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 ignored->e로 변경하면 좋을것같다고 해서 다른 파일들도 e로 수정했습니다!

@librawish808 librawish808 merged commit 801a7cc into develop Feb 15, 2026
2 checks passed
@librawish808 librawish808 deleted the refactor/Log.d-Naiper-Kermit-#262 branch February 15, 2026 10:35
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.

[Refactor] Log.d 제거

3 participants