Skip to content

refactor: logger improvements #19

Merged
minjae999 merged 2 commits intomainfrom
fix/logger
Jan 5, 2026
Merged

refactor: logger improvements #19
minjae999 merged 2 commits intomainfrom
fix/logger

Conversation

@minjae999
Copy link
Contributor

@minjae999 minjae999 commented Dec 31, 2025

Summary

  • Split legacy log flag into separate isLegacyLogSubsystemEnabled and isLegacyLogCategoryEnabled options for more granular control
  • Simplified legacy log header format with consistent formatting
  • Removed unused SabySafe dependency from multiple modules
  • Fixed ScreenFetcher to properly return promise result in then block
  • Updated iOS deployment target to iOS 12 across all platforms

Changes

Logger Settings

  • Added two new boolean flags to LoggerSetting:
    • isLegacyLogSubsystemEnabled: Controls whether to show subsystem in log header
    • isLegacyLogCategoryEnabled: Controls whether to show category in log header

Log Service

  • Refactored printLog method to compute header dynamically based on enabled flags
  • Improved readability by separating header, content, and footer computation
  • Pagination logic now consistently applies header formatting

@minjae999 minjae999 self-assigned this Dec 31, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 31, 2025

개요

레거시 로깅 기능을 제어하는 단일 불린 플래그를 두 개의 독립적인 플래그로 분리하여 서브시스템과 카테고리 로깅을 개별적으로 활성화할 수 있도록 개선했습니다. 헤더 구성 로직도 조건부 기반으로 재작성되었습니다.

변경 사항

응집도 / 파일 변경 요약
플래그 구조 재설계
Source/AppleLogger/Data/LoggerSetting.swift
isLegacyLogEnabled 단일 플래그 제거 → isLegacyLogSubsystemEnabled, isLegacyLogCategoryEnabled 두 개의 독립적인 공개 불린 플래그 추가 (기본값: false)
헤더 구성 로직 수정
Source/AppleLogger/Implement/LogService.swift
고정된 "[subsystem][category]\n" 형식 → 각 플래그에 따라 "[subsystem]" 및/또는 "[category]"를 조건부로 추가하는 동적 헤더 조립 방식으로 변경

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~10분

🐰 한 깃발 둘로 나누어
더 섬세한 로그의 춤을 추고
조건에 따라 옷을 갈아입는
똑똑한 헤더의 마술
유연함이 피어난다! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive 제목이 전체 변경 사항의 핵심을 정확히 나타내지 못합니다. PR은 로거 설정 분리, 헤더 형식 개선, 의존성 제거, iOS 배포 대상 업데이트, ScreenFetcher 버그 수정 등 여러 주요 변경사항을 포함하고 있으나, 제목은 매우 모호한 'logger improvements'로만 표현되어 있습니다. 제목을 더 구체적으로 수정하세요. 예: 'refactor: split legacy log flags and update deployment targets' 또는 'refactor: granular legacy logging control and dependency cleanup'
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed 설명이 변경 사항과 충분히 관련되어 있으며, 로거 설정 분리, 로그 서비스 리팩토링, 의존성 제거, 배포 대상 업데이트에 대해 구체적으로 설명하고 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings

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

@minjae999 minjae999 requested a review from 0xWOF December 31, 2025 07:27
Copy link

@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: 0

Caution

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

⚠️ Outside diff range comments (1)
Source/AppleLogger/Implement/LogService.swift (1)

61-69: PrintLogService에서 레거시 플래그 활성화 시 중복된 헤더 정보가 출력됩니다.

65번 줄에서 생성한 포맷된 메시지 "[subsystem/category/level] message"가 66번 줄의 extension 메서드로 전달되면, extension이 레거시 플래그 설정에 따라 추가 헤더를 앞에 붙입니다. 레거시 플래그가 모두 활성화된 경우 최종 출력은 "[subsystem][category] [subsystem/category/level] message"가 되어 subsystem과 category 정보가 중복됩니다.

OSLogService는 원본 메시지를 그대로 전달하고 os_log가 자체 포매팅을 처리하므로 이러한 중복이 발생하지 않습니다. PrintLogService에서는 자체 포맷 문자열을 제거하거나, 레거시 플래그 활성화 시 자체 포맷을 조정하는 것을 검토하세요.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0126113 and 3583c52.

📒 Files selected for processing (2)
  • Source/AppleLogger/Data/LoggerSetting.swift
  • Source/AppleLogger/Implement/LogService.swift
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: task-list-completed
🔇 Additional comments (2)
Source/AppleLogger/Data/LoggerSetting.swift (1)

17-21: LGTM! 깔끔한 API 개선입니다.

단일 플래그를 두 개의 세분화된 플래그로 분리한 것은 더 나은 제어와 유연성을 제공합니다. 네이밍, 문서화, 기본값 모두 적절합니다.

Source/AppleLogger/Implement/LogService.swift (1)

21-30: LGTM! 헤더 구성 로직이 우수합니다.

즉시 실행 클로저를 사용한 헤더 구성은 깔끔하고 효율적입니다. 조건부 로직이 올바르게 구현되었으며 페이지네이션에도 일관되게 적용됩니다.

@minjae999 minjae999 changed the title refactor: logger improvements and dependency cleanup refactor: logger improvements Dec 31, 2025
Copy link
Member

@0xWOF 0xWOF left a comment

Choose a reason for hiding this comment

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

Good

@minjae999 minjae999 merged commit b8a9a8f into main Jan 5, 2026
2 of 3 checks passed
@minjae999 minjae999 deleted the fix/logger branch January 5, 2026 02:03
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