Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion NativeAppTemplate/Logging/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import os

private let appLogger = os.Logger(subsystem: "com.nativeapptemplate", category: "app")
let appLogger = os.Logger(subsystem: "com.nativeapptemplate", category: "app")

struct Failure {
static func signUp(from source: (some Any).Type, reason: String) -> Self {
Expand Down
9 changes: 3 additions & 6 deletions NativeAppTemplate/Login/LoginRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import os

@MainActor @Observable public class LoginRepository: LoginRepositoryProtocol {
// MARK: - Properties
Expand All @@ -18,9 +19,7 @@ import Foundation
let loggedInShopkeeper = try keychainStore.retrieve()
_currentShopkeeper = Shopkeeper(from: loggedInShopkeeper)
} catch {
#if DEBUG
print(error)
#endif
appLogger.debug("LoginRepository retrieve error: \(error, privacy: .private)")
}
}
return _currentShopkeeper
Expand Down Expand Up @@ -88,9 +87,7 @@ import Foundation
do {
try keychainStore.remove()
} catch {
#if DEBUG
print(error)
#endif
appLogger.debug("LoginRepository remove error: \(error, privacy: .private)")
}
}
}
5 changes: 2 additions & 3 deletions NativeAppTemplate/Login/SignUpRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import os

@MainActor class SignUpRepository: SignUpRepositoryProtocol {
func signUp(signUp: SignUp) async throws -> Shopkeeper {
Expand Down Expand Up @@ -100,9 +101,7 @@ import Foundation
do {
try keychainStore.remove()
} catch {
#if DEBUG
print(error)
#endif
appLogger.debug("SignUpRepository remove error: \(error, privacy: .private)")
}
}
}
9 changes: 3 additions & 6 deletions NativeAppTemplate/NFCManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@preconcurrency import CoreNFC
import Foundation
import os

protocol NFCManagerProtocol: Sendable {
@MainActor var scanResult: Result<ItemTagData, Error>? { get }
Expand Down Expand Up @@ -205,9 +206,7 @@ extension NFCManager: NFCNDEFReaderSessionDelegate {
isLock: isLock
) { error in
guard error == nil else { return }
#if DEBUG
print(">>> Write: \(userNdefMessage)")
#endif
appLogger.debug("NFC Write: \(userNdefMessage, privacy: .private)")
}
}

Expand Down Expand Up @@ -265,8 +264,6 @@ extension NFCManager: NFCNDEFReaderSessionDelegate {
func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) {}

func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) {
#if DEBUG
print("readerSession error: \(error.localizedDescription)")
#endif
appLogger.debug("readerSession error: \(error.localizedDescription, privacy: .private)")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Foundation
import KeychainAccess
import os

enum KeychainStoreError: Error {
case secCallFailed(Error)
Expand Down Expand Up @@ -60,9 +61,7 @@ extension KeychainStore {

func store(_ data: DataType) throws {
let archived: Data
#if DEBUG
print("data: \(data)")
#endif
appLogger.debug("KeychainStore data: \(data, privacy: .private)")
do {
archived = try NSKeyedArchiver.archivedData(withRootObject: data, requiringSecureCoding: true)
} catch {
Expand Down
9 changes: 3 additions & 6 deletions NativeAppTemplate/Utilities/Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import CoreNFC
import Foundation
import os

enum Utility {
static func scanUrl(itemTagId: String, itemTagType: String) -> URL {
Expand Down Expand Up @@ -75,16 +76,12 @@ enum Utility {
if let itemTagId = item.value {
itemTagInfo.id = itemTagId
}
#if DEBUG
print("item_tag_id: \(String(describing: itemTagInfo.id))")
#endif
appLogger.debug("item_tag_id: \(String(describing: itemTagInfo.id), privacy: .private)")
case "type":
if let type = item.value {
itemTagInfo.type = type
}
#if DEBUG
print("type: \(String(describing: itemTagInfo.type))")
#endif
appLogger.debug("type: \(String(describing: itemTagInfo.type), privacy: .private)")
default:
break
}
Expand Down
Loading