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

[MLModelDownloader] Use FirebaseLogger instead of GULLoggerWrapper #13160

Merged
merged 3 commits into from
Jun 20, 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
1 change: 0 additions & 1 deletion FirebaseCore/Extension/FIRLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ NS_SWIFT_NAME(FirebaseLogger)
/// three-character service identifier and a six digit integer message ID that is unique within
/// the service. An example of the message code is @"I-COR000001".
/// - message: Formatted string to be used as the log's message.
/// - args: Arguments list obtained from calling `va_start`, used when message is a format string.
+ (void)logWithLevel:(FIRLoggerLevel)level
service:(FIRLoggerService)service
code:(NSString *)code
Expand Down
3 changes: 1 addition & 2 deletions FirebaseMLModelDownloader.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ Pod::Spec.new do |s|

s.framework = 'Foundation'
s.dependency 'FirebaseCore', '~> 10.0'
s.dependency 'FirebaseCoreExtension', '~> 10.29'
s.dependency 'FirebaseInstallations', '~> 10.0'
s.dependency 'GoogleDataTransport', '~> 9.2'
# TODO: Revisit this dependency
s.dependency 'GoogleUtilities/Logger', '~> 7.13'
s.dependency 'GoogleUtilities/UserDefaults', '~> 7.13'
s.dependency 'SwiftProtobuf', '~> 1.19'

Expand Down
19 changes: 5 additions & 14 deletions FirebaseMLModelDownloader/Sources/DeviceLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
// limitations under the License.

import Foundation
#if SWIFT_PACKAGE
@_implementationOnly import GoogleUtilities_Logger
#else
@_implementationOnly import GoogleUtilities
#endif

@_implementationOnly import FirebaseCoreExtension

/// Enum of log messages.
enum LoggerMessageCode: Int {
Expand Down Expand Up @@ -76,15 +73,9 @@ enum DeviceLogger {
/// Log identifier.
static let service = "[Firebase/MLModelDownloader]"

static func logEvent(level: GoogleLoggerLevel, message: String, messageCode: LoggerMessageCode) {
static func logEvent(level: FirebaseLoggerLevel, message: String,
messageCode: LoggerMessageCode) {
let code = String(format: "I-MLM%06d", messageCode.rawValue)
let args: [CVarArg] = []
GULLoggerWrapper.log(
with: level,
withService: DeviceLogger.service,
withCode: code,
withMessage: message,
withArgs: getVaList(args)
)
FirebaseLogger.log(level: level, service: DeviceLogger.service, code: code, message: message)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@testable import FirebaseMLModelDownloader
import XCTest
#if SWIFT_PACKAGE
@_implementationOnly import GoogleUtilities_Logger
@_implementationOnly import GoogleUtilities_UserDefaults
#else
@_implementationOnly import GoogleUtilities
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,9 @@ let package = Package(
name: "FirebaseMLModelDownloader",
dependencies: [
"FirebaseCore",
"FirebaseCoreExtension",
"FirebaseInstallations",
.product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
.product(name: "GULLogger", package: "GoogleUtilities"),
.product(name: "GULUserDefaults", package: "GoogleUtilities"),
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
],
Expand Down
Loading