Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
742aeb8
[Feature] DiskCache 클래스 구현 (#109)
NeoSelf1 Feb 22, 2025
3cf7d37
[Delete] 불필요 라이브러리 import문 제거 (#109)
NeoSelf1 Feb 22, 2025
cab7e9d
[Refactor] 동시성 제어 관련 컴파일 에러 해결 (#109)
NeoSelf1 Feb 22, 2025
2d105ab
[Refactor] Actor 어노테이션 불필요한 곳 수정 (#109)
NeoSelf1 Feb 22, 2025
722a706
[Feat] ImageProcessor 추가 (#109)
NeoSelf1 Feb 24, 2025
5e82583
[Feat] ImageWrapper 추가 (#109)
NeoSelf1 Feb 24, 2025
daddb31
[Feat] ImageDownloader 구현 (#109)
NeoSelf1 Feb 24, 2025
852c52c
[Fix] Task-isolated options 관련 에러 수정 위해 임시 커밋 (#109)
NeoSelf1 Feb 24, 2025
152b503
[Fix] Concurrency 문제 해결 (#109)
NeoSelf1 Feb 24, 2025
c1006f6
[Fix] NeoImageWrapper 자체를 Sendable하게 변경하여 해결 (#109)
NeoSelf1 Feb 24, 2025
ee1273c
[Refactor] ImageCache 패키지 구현 (#109)
NeoSelf1 Feb 24, 2025
f636f62
[Refactor] 디렉토리 구조 변경 (#109)
NeoSelf1 Feb 26, 2025
0942e0b
[Feat] 메모리 및 디스크 저장소 조회하여 기존 이미지 가져오는 로직 추가 (#109)
NeoSelf1 Feb 26, 2025
7e72a5c
[Refactor] BookMatchKit loggers 초기과 구문 임시 저장
NeoSelf1 Mar 2, 2025
b2922a3
[Feat] LogCategory, LogSubsystem, LogLevel 열거형 정의
NeoSelf1 Mar 2, 2025
f56862b
[Feat] LogKitActor 및 LogKit 클래스 구현체 구현
NeoSelf1 Mar 2, 2025
a50887a
[Feat] LogKit Facade 계층 구현
NeoSelf1 Mar 2, 2025
72831f4
[Refactor] CSV 파일 형식에 맞춰 다중라인 출력 String문 단일라인으로 수정
NeoSelf1 Mar 2, 2025
422e571
[Delete] 각종 모듈에서 사용되고 있던 Logger 일괄 제거 및 LogKit로 통합
NeoSelf1 Mar 2, 2025
f345304
[Refactor] 각 패키지에 대해 LogKit 패키지 의존성 추가
NeoSelf1 Mar 2, 2025
6d43051
[Refactor] Log 관련 메서드 모두 LogKit 패키지 메서드로 일괄 변경
NeoSelf1 Mar 2, 2025
610e367
[Refactor] DesignSystem 라이브러리 내부 Kingfisher 라이브러리 의존성 제거 및 LogKit 내부 …
NeoSelf1 Mar 2, 2025
4a9ef1f
[Feat] Swift 6 점진적 대응 위한 컴파일 버전 낮추기
ericKwon95 Mar 18, 2025
7d1c4bb
[Feat] FIFO 순서의 로깅 위한 시리얼큐 적용
ericKwon95 Mar 18, 2025
67f3355
[Refactor] 파일 쓰기, 로그 엔진, 로그 엔진 래퍼로 역할 및 파일 분리
ericKwon95 Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions BookKitty/BookKitty.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
606DA2452D42076100C7FAA3 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = 606DA2442D42076100C7FAA3 /* Then */; };
606DA2482D42079900C7FAA3 /* Differentiator in Frameworks */ = {isa = PBXBuildFile; productRef = 606DA2472D42079900C7FAA3 /* Differentiator */; };
60A1CC0E2D54A2DB00091568 /* BookRecommendationKit in Frameworks */ = {isa = PBXBuildFile; productRef = 60A1CC0D2D54A2DB00091568 /* BookRecommendationKit */; };
E56D6D062D73E8C500B6E6E9 /* LogKit in Frameworks */ = {isa = PBXBuildFile; productRef = E56D6D052D73E8C500B6E6E9 /* LogKit */; };
E5A6B99D2D5F54C300A2E06D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = E5A6B99C2D5F54C300A2E06D /* PrivacyInfo.xcprivacy */; };
E5A6B99E2D5F54C300A2E06D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = E5A6B99C2D5F54C300A2E06D /* PrivacyInfo.xcprivacy */; };
E5DE19642D62A7D3007D37E2 /* BookOCRKit in Frameworks */ = {isa = PBXBuildFile; productRef = E5DE19632D62A7D3007D37E2 /* BookOCRKit */; };
E5FC698C2D52414B002875FD /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = E5FC698B2D52414B002875FD /* SnapKit */; };
E5FFE2F02D6A3F4200A0F7CF /* NeoImage in Frameworks */ = {isa = PBXBuildFile; productRef = E5FFE2EF2D6A3F4200A0F7CF /* NeoImage */; };
E93048662D559553008E9467 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = E93048652D559553008E9467 /* RxCocoa */; };
E97DC3702D50C161009ADFEA /* DesignSystem in Frameworks */ = {isa = PBXBuildFile; productRef = E97DC36F2D50C161009ADFEA /* DesignSystem */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -80,13 +82,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E56D6D062D73E8C500B6E6E9 /* LogKit in Frameworks */,
606DA2452D42076100C7FAA3 /* Then in Frameworks */,
E93048662D559553008E9467 /* RxCocoa in Frameworks */,
E5FC698C2D52414B002875FD /* SnapKit in Frameworks */,
E5DE19642D62A7D3007D37E2 /* BookOCRKit in Frameworks */,
606DA2402D4206F200C7FAA3 /* RxRelay in Frameworks */,
E97DC3702D50C161009ADFEA /* DesignSystem in Frameworks */,
4584C5AF2D685AB300173282 /* FirebaseAnalytics in Frameworks */,
E5FFE2F02D6A3F4200A0F7CF /* NeoImage in Frameworks */,
60A1CC0E2D54A2DB00091568 /* BookRecommendationKit in Frameworks */,
606DA2422D4206F200C7FAA3 /* RxSwift in Frameworks */,
4584C5B32D685AB300173282 /* FirebaseCrashlytics in Frameworks */,
Expand Down Expand Up @@ -170,6 +174,8 @@
4584C5AE2D685AB300173282 /* FirebaseAnalytics */,
4584C5B02D685AB300173282 /* FirebaseCore */,
4584C5B22D685AB300173282 /* FirebaseCrashlytics */,
E5FFE2EF2D6A3F4200A0F7CF /* NeoImage */,
E56D6D052D73E8C500B6E6E9 /* LogKit */,
);
productName = BookKitty;
productReference = 60551C652D40E6E800CFC16A /* BookKitty.app */;
Expand Down Expand Up @@ -346,7 +352,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUHZ238M29;
DEVELOPMENT_TEAM = H856SYKNM8;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BookKitty/App/Info.plist;
Expand Down Expand Up @@ -385,7 +391,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUHZ238M29;
DEVELOPMENT_TEAM = H856SYKNM8;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BookKitty/App/Info.plist;
Expand Down Expand Up @@ -695,6 +701,10 @@
isa = XCSwiftPackageProductDependency;
productName = BookRecommendationKit;
};
E56D6D052D73E8C500B6E6E9 /* LogKit */ = {
isa = XCSwiftPackageProductDependency;
productName = LogKit;
};
E5DE19632D62A7D3007D37E2 /* BookOCRKit */ = {
isa = XCSwiftPackageProductDependency;
productName = BookOCRKit;
Expand All @@ -704,6 +714,10 @@
package = E5FC698A2D52414B002875FD /* XCRemoteSwiftPackageReference "SnapKit" */;
productName = SnapKit;
};
E5FFE2EF2D6A3F4200A0F7CF /* NeoImage */ = {
isa = XCSwiftPackageProductDependency;
productName = NeoImage;
};
E93048652D559553008E9467 /* RxCocoa */ = {
isa = XCSwiftPackageProductDependency;
package = 606DA23C2D4206F200C7FAA3 /* XCRemoteSwiftPackageReference "RxSwift" */;
Expand Down
10 changes: 10 additions & 0 deletions BookKitty/BookKitty/BookMatchKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,46 @@ let package = Package(
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.8.0"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.55.0"),
.package(path: "../NetworkKit"),
.package(path: "../LogKit"),
],
targets: [
.target(
name: "BookOCRKit",
dependencies: [
"RxSwift", "SwiftFormat",
"BookMatchCore", "BookMatchAPI", "BookMatchStrategy", "BookMatchService",
.product(name: "LogKit", package: "LogKit"),
]
),
.target(
name: "BookRecommendationKit",
dependencies: [
"RxSwift", "SwiftFormat",
"BookMatchCore", "BookMatchAPI", "BookMatchService",
.product(name: "LogKit", package: "LogKit"),
]
),
.target(
name: "BookMatchStrategy",
dependencies: [
"RxSwift", "SwiftFormat",
"BookMatchCore",
.product(name: "LogKit", package: "LogKit"),
]
),
.target(
name: "BookMatchCore",
dependencies: [
"RxSwift", "SwiftFormat",
.product(name: "LogKit", package: "LogKit"),
]
),
.target(
name: "BookMatchService",
dependencies: [
"RxSwift", "SwiftFormat",
"BookMatchCore", "BookMatchAPI",
.product(name: "LogKit", package: "LogKit"),
],
resources: [
.process("Resources/MyObjectDetector5_1.mlmodel"),
Expand All @@ -83,13 +89,17 @@ let package = Package(
"RxSwift", "SwiftFormat",
"BookMatchCore",
.product(name: "NetworkKit", package: "NetworkKit"),
.product(name: "LogKit", package: "LogKit"),
]
),
.testTarget(
name: "BookMatchKitTests",
dependencies: [
"RxSwift", "SwiftFormat",
"BookOCRKit", "BookRecommendationKit", "BookMatchCore",
],
resources: [
.process("Resources/images"),
]
),
]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import BookMatchAPI
import BookMatchCore
import BookMatchStrategy
import LogKit
import RxSwift

public final class BookValidationService: BookValidatable {
Expand Down Expand Up @@ -45,7 +46,11 @@ public final class BookValidationService: BookValidatable {
previousBooks: [RawBook],
openAiAPI: OpenAIAPI
) -> Single<BookItem?> {
BookMatchLogger.bookConversionStarted(title: book.title, author: book.author)
LogKit.info(
"도서 매칭 중: \(book.title) : \(book.author)",
subSystem: .bookRecommendation,
category: .lifecycle
)

var retryCount = 0
var currentBook = book
Expand All @@ -71,9 +76,10 @@ public final class BookValidationService: BookValidatable {
candidates.append((matchedBook, result.similarity))
retryCount += 1

BookMatchLogger.retryingBookMatch(
attempt: retryCount,
currentBook: matchedBook
LogKit.info(
"GPT에게 도서 재요청 및 재시도: \(retryCount)/3 - 현재 도서 = \(matchedBook.title) : \(matchedBook.author)",
subSystem: .bookRecommendation,
category: .lifecycle
)

return openAiAPI.getAdditionalBook(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BookMatchCore
import CoreImage
import LogKit
import NaturalLanguage
import RxSwift
import UIKit
Expand Down Expand Up @@ -61,16 +62,21 @@ public final class TextExtractionService: TextExtractable {
return .error(BookMatchError.CoreMLError("No Result from CoreML"))
}

BookMatchLogger.textsExtracted(texts)
LogKit.info(
"OCR로 추출된 텍스트: \(texts.joined(separator: ", "))",
subSystem: .bookOCR,
category: .lifecycle
)

return .just(texts)
}
}
.catch { [weak self] error in
.catch { [weak self] _ in
guard let self else {
return .error(BookMatchError.deinitError)
}

BookMatchLogger.error(error, context: "extract Text")
LogKit.error("extract Text", subSystem: .bookOCR)

return performOCR(on: image)
}
Expand Down Expand Up @@ -151,7 +157,12 @@ public final class TextExtractionService: TextExtractable {
$0.topCandidates(1).first?.string
}

BookMatchLogger.textExtracted(recognizedText)
LogKit.info(
"OCR로 추출된 텍스트: \(recognizedText.joined(separator: ", "))",
subSystem: .bookOCR,
category: .lifecycle
)

single(.success(recognizedText))
}

Expand All @@ -167,8 +178,8 @@ public final class TextExtractionService: TextExtractable {

return Disposables.create()
}
.catch { error in
BookMatchLogger.error(error, context: "performOCR")
.catch { _ in
LogKit.error("performOCR", subSystem: .bookOCR)
return .just([])
}
}
Expand Down Expand Up @@ -217,12 +228,12 @@ public final class TextExtractionService: TextExtractable {
context: nil,
options: nil
) else {
BookMatchLogger.detectorInitializationFailed()
LogKit.error("CIDetector 초기화 실패", subSystem: .bookOCR)
return image
}

guard let feature = detector.features(in: image).first as? CIRectangleFeature else {
BookMatchLogger.textSlopeDetectionFailed()
LogKit.error("텍스트 기울기 감지 실패", subSystem: .bookOCR)
return image
}

Expand Down
Loading