Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: (#1167) Firebase Send Error #1184

Merged
merged 3 commits into from
Aug 18, 2024
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
35 changes: 35 additions & 0 deletions Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import FirebaseAnalytics
import FirebaseCrashlytics
import FirebaseCrashlyticsSwift
import Foundation
import OSLog
import ThirdPartyLib
Expand Down Expand Up @@ -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))",
Expand Down Expand Up @@ -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
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import FirebaseCrashlytics
import Foundation
import LogManager
import RxSwift
Expand Down Expand Up @@ -65,6 +66,7 @@ public extension PreferenceManager {

static func clearUserInfo() {
LogManager.setUserID(userID: nil)
Crashlytics.crashlytics().setUserID(nil)
PreferenceManager.userInfo = nil
}
}
Loading