From d1797258c785f14dccc6a7738bb89a097d057a90 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sat, 17 Aug 2024 22:00:56 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:sparkles:=20::=20[#1167]=20Firebase?= =?UTF-8?q?=EC=97=90=20=EB=A1=9C=EA=B7=B8=EB=A5=BC=20=EB=B3=B4=EB=82=BC=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EA=B2=8C=20=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/AnalyticsLogManager.swift | 35 +++++++++++++++++++ .../Extension+PreferenceManager.swift | 1 + 2 files changed, 36 insertions(+) diff --git a/Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift b/Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift index 45d597497..ceb64d3b6 100644 --- a/Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift +++ b/Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift @@ -1,4 +1,6 @@ import FirebaseAnalytics +import FirebaseCrashlytics +import FirebaseCrashlyticsSwift import Foundation import OSLog import ThirdPartyLib @@ -70,6 +72,7 @@ public extension LogManager { line: Int = #line ) { Analytics.setUserID(userID) + Crashlytics.crashlytics().setUserID(userID) LogManager.printDebug( "Set Analytics UserID : \(String(describing: userID))", @@ -126,4 +129,36 @@ public extension LogManager { line: line ) } + + static func sendError( + message: String, + file: String = #file, + function: String = #function, + line: Int = #line + ) { + Crashlytics.crashlytics().log(message) + LogManager.log( + message, + level: .error, + file: file, + function: function, + line: line + ) + } + + static func sendError( + error: any Error, + file: String = #file, + function: String = #function, + line: Int = #line + ) { + Crashlytics.crashlytics().record(error: error) + LogManager.log( + error, + level: .error, + file: file, + function: function, + line: line + ) + } } diff --git a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift index f90c7ed51..8a776a102 100644 --- a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift +++ b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift @@ -65,6 +65,7 @@ public extension PreferenceManager { static func clearUserInfo() { LogManager.setUserID(userID: nil) + Crashlytics.crashlytics().setUserID(nil) PreferenceManager.userInfo = nil } } From 8f0fd388f76784292a71120e158619c8ecd8beaa Mon Sep 17 00:00:00 2001 From: baegteun Date: Sat, 17 Aug 2024 22:16:50 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:sparkles:=20::=20[#1167]=20=EB=86=93?= =?UTF-8?q?=EC=B9=9C=20import=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utility/Sources/Extensions/Extension+PreferenceManager.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift index 8a776a102..0c48690ab 100644 --- a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift +++ b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift @@ -8,6 +8,7 @@ import Foundation import LogManager +import FirebaseCrashlytics import RxSwift public extension PreferenceManager { From a164956633569307ea5641594efe3ede69e5cc59 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sat, 17 Aug 2024 22:16:55 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Extensions/Extension+PreferenceManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift index 0c48690ab..c1afd1e1f 100644 --- a/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift +++ b/Projects/Modules/Utility/Sources/Extensions/Extension+PreferenceManager.swift @@ -6,9 +6,9 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // +import FirebaseCrashlytics import Foundation import LogManager -import FirebaseCrashlytics import RxSwift public extension PreferenceManager {