diff --git a/Sources/MapboxMaps/Annotations/Annotation.swift b/Sources/MapboxMaps/Annotations/Annotation.swift index 42f41b7fd24c..dd70dbafa570 100644 --- a/Sources/MapboxMaps/Annotations/Annotation.swift +++ b/Sources/MapboxMaps/Annotations/Annotation.swift @@ -87,7 +87,7 @@ extension Array where Element: Annotation { let duplicates = self.removeDuplicates(by: \.id) if !duplicates.isEmpty { let ids = duplicates.lazy.map(\.id).joined(separator: ", ") - Log.error(forMessage: "Duplicated annotations: \(ids)", category: "Annotations") + Log.error("Duplicated annotations: \(ids)", category: "Annotations") } } } diff --git a/Sources/MapboxMaps/Annotations/AnnotationImagesManager.swift b/Sources/MapboxMaps/Annotations/AnnotationImagesManager.swift index 7db67a2c962b..842b2edd2567 100644 --- a/Sources/MapboxMaps/Annotations/AnnotationImagesManager.swift +++ b/Sources/MapboxMaps/Annotations/AnnotationImagesManager.swift @@ -60,7 +60,7 @@ internal final class AnnotationImagesManager: AnnotationImagesManagerProtocol { addedAnnotationImages.insert(id) } catch { Log.warning( - forMessage: "Could not add image to style due to error: \(error)", + "Could not add image to style due to error: \(error)", category: "Annnotations") } } @@ -75,7 +75,7 @@ internal final class AnnotationImagesManager: AnnotationImagesManagerProtocol { addedAnnotationImages.remove(imageName) } catch { Log.warning( - forMessage: "Could not remove image from style due to error: \(error)", + "Could not remove image from style due to error: \(error)", category: "Annnotations") } } diff --git a/Sources/MapboxMaps/Annotations/AnnotationManagerImpl.swift b/Sources/MapboxMaps/Annotations/AnnotationManagerImpl.swift index 879a88d79ad3..dbc8c9f846a0 100644 --- a/Sources/MapboxMaps/Annotations/AnnotationManagerImpl.swift +++ b/Sources/MapboxMaps/Annotations/AnnotationManagerImpl.swift @@ -96,7 +96,7 @@ final class AnnotationManagerImpl Void) { do { try closure() } catch { - Log.error(forMessage: "\(error)", category: "StyleDSL") + Log.error("\(error)", category: "StyleDSL") } } diff --git a/Sources/MapboxMaps/ContentBuilders/Tree/MapContentReconciler.swift b/Sources/MapboxMaps/ContentBuilders/Tree/MapContentReconciler.swift index d8b15a9ec9ed..bc85d8b96a82 100644 --- a/Sources/MapboxMaps/ContentBuilders/Tree/MapContentReconciler.swift +++ b/Sources/MapboxMaps/ContentBuilders/Tree/MapContentReconciler.swift @@ -113,7 +113,7 @@ private extension MapContentNodeContext { initialMapUniqueProperties.transition = TransitionOptions(style.styleManager.getStyleTransition()) return initialMapUniqueProperties } catch { - Log.warning(forMessage: "Unable to decode initial MapContentUniqueProperties \(error) from StyleJSON", category: "StyleDSL") + Log.warning("Unable to decode initial MapContentUniqueProperties \(error) from StyleJSON", category: "StyleDSL") return nil } } diff --git a/Sources/MapboxMaps/Foundation/Extensions/Core/RenderedQueryOptions.swift b/Sources/MapboxMaps/Foundation/Extensions/Core/RenderedQueryOptions.swift index 6a5f6f90e2b4..f11bb92e32d9 100644 --- a/Sources/MapboxMaps/Foundation/Extensions/Core/RenderedQueryOptions.swift +++ b/Sources/MapboxMaps/Foundation/Extensions/Core/RenderedQueryOptions.swift @@ -13,7 +13,7 @@ extension RenderedQueryOptions { do { filterJson = try filter.toJSON() } catch { - Log.error(forMessage: "Filter expression could not be encoded", category: "RenderedQueryOptions") + Log.error("Filter expression could not be encoded", category: "RenderedQueryOptions") } } @@ -30,7 +30,7 @@ extension RenderedQueryOptions { let filterData = try JSONSerialization.data(withJSONObject: filter, options: []) filterExp = try JSONDecoder().decode(Exp.self, from: filterData) } catch { - Log.error(forMessage: "Filter expression could not be decoded", category: "RenderedQueryOptions") + Log.error("Filter expression could not be decoded", category: "RenderedQueryOptions") } return filterExp diff --git a/Sources/MapboxMaps/Foundation/Extensions/Image.swift b/Sources/MapboxMaps/Foundation/Extensions/Image.swift index 48aedbda334f..6df552ed754f 100644 --- a/Sources/MapboxMaps/Foundation/Extensions/Image.swift +++ b/Sources/MapboxMaps/Foundation/Extensions/Image.swift @@ -10,7 +10,7 @@ extension CoreMapsImage { /// - uiImage: The source image. internal convenience init?(uiImage: UIImage) { guard let data = Data(uiImage: uiImage) else { - Log.warning(forMessage: "Failed to convert UIImage") + Log.warning("Failed to convert UIImage") return nil } diff --git a/Sources/MapboxMaps/Foundation/Extensions/UIWindow+ParentScene.swift b/Sources/MapboxMaps/Foundation/Extensions/UIWindow+ParentScene.swift index 10ae366de23d..a2da8bdaedf9 100644 --- a/Sources/MapboxMaps/Foundation/Extensions/UIWindow+ParentScene.swift +++ b/Sources/MapboxMaps/Foundation/Extensions/UIWindow+ParentScene.swift @@ -49,7 +49,7 @@ extension UIScene { } } #endif - Log.info(forMessage: "Found no window attached to the current scene: \(self)") + Log.info("Found no window attached to the current scene: \(self)") return [] } } diff --git a/Sources/MapboxMaps/Foundation/Logger.swift b/Sources/MapboxMaps/Foundation/Logger.swift index e62a7da32278..bde05f0547ab 100644 --- a/Sources/MapboxMaps/Foundation/Logger.swift +++ b/Sources/MapboxMaps/Foundation/Logger.swift @@ -1,30 +1,64 @@ import Foundation @_implementationOnly import MapboxCommon_Private.MBXLog_Internal -internal struct Log { +/// A logging utility with MapboxCommon backend by default. +@_spi(Logging) public struct Log { private typealias Logger = MapboxCommon_Private.Log private static func logCategory(_ additionalCategory: String?) -> String { let logPrefix = "maps-ios" - guard let additionalCategory = additionalCategory else { + guard let additionalCategory = additionalCategory, !additionalCategory.isEmpty else { return logPrefix } return "\(logPrefix)/\(additionalCategory)" } - internal static func debug(forMessage message: String, category: String? = nil) { - Logger.debug(forMessage: message, category: logCategory(category)) + /// Log a debug message. + @_spi(Logging) public static func debug(_ message: String, category: Category? = nil) { + Logger.debug(forMessage: message, category: logCategory(category?.rawValue)) } - internal static func info(forMessage message: String, category: String? = nil) { - Logger.info(forMessage: message, category: logCategory(category)) + /// Log an info message. + @_spi(Logging) public static func info(_ message: String, category: Category? = nil) { + Logger.info(forMessage: message, category: logCategory(category?.rawValue)) } - internal static func warning(forMessage message: String, category: String? = nil) { - Logger.warning(forMessage: message, category: logCategory(category)) + /// Log a warning message. + @_spi(Logging) public static func warning(_ message: String, category: Category? = nil) { + Logger.warning(forMessage: message, category: logCategory(category?.rawValue)) } - internal static func error(forMessage message: String, category: String? = nil) { - Logger.error(forMessage: message, category: logCategory(category)) + /// Log an error message. + @_spi(Logging) public static func error(_ message: String, category: Category? = nil) { + Logger.error(forMessage: message, category: logCategory(category?.rawValue)) } } + +extension Log { + @_spi(Logging) public struct Category: RawRepresentable, ExpressibleByStringLiteral { + public let rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + + init(_ value: String) { + self.rawValue = value + } + + public init(stringLiteral value: StringLiteralType) { + self.rawValue = value + } + + public init(unicodeScalarLiteral value: String) { + self.rawValue = value + } + + public init(extendedGraphemeClusterLiteral value: String) { + self.rawValue = value + } + + static let `default` = Category("") + } + +} diff --git a/Sources/MapboxMaps/Foundation/MapView+Attribution.swift b/Sources/MapboxMaps/Foundation/MapView+Attribution.swift index 3ab80a43e159..039b58c46c23 100644 --- a/Sources/MapboxMaps/Foundation/MapView+Attribution.swift +++ b/Sources/MapboxMaps/Foundation/MapView+Attribution.swift @@ -9,11 +9,11 @@ extension MapView: AttributionDialogManagerDelegate { func attributionDialogManager(_ attributionDialogManager: AttributionDialogManager, didTriggerActionFor attribution: Attribution) { switch attribution.kind { case .actionable(let url): - Log.debug(forMessage: "Open url: \(url))", category: "Attribution") + Log.debug("Open url: \(url))", category: "Attribution") attributionUrlOpener.openAttributionURL(url) case .feedback: let url = mapboxFeedbackURL() - Log.debug(forMessage: "Open url: \(url))", category: "Attribution") + Log.debug("Open url: \(url))", category: "Attribution") attributionUrlOpener.openAttributionURL(url) case .nonActionable: break diff --git a/Sources/MapboxMaps/Foundation/MapView+Snapshot.swift b/Sources/MapboxMaps/Foundation/MapView+Snapshot.swift index 2506c25a9f31..542248716d26 100644 --- a/Sources/MapboxMaps/Foundation/MapView+Snapshot.swift +++ b/Sources/MapboxMaps/Foundation/MapView+Snapshot.swift @@ -23,7 +23,7 @@ extension MapView { } guard let metalView = metalView else { - Log.error(forMessage: "No metal view present.", category: "MapView.snapshot") + Log.error("No metal view present.", category: "MapView.snapshot") throw SnapshotError.noMetalView } diff --git a/Sources/MapboxMaps/Foundation/MapView.swift b/Sources/MapboxMaps/Foundation/MapView.swift index 2715e1065b26..ff95abb380e3 100644 --- a/Sources/MapboxMaps/Foundation/MapView.swift +++ b/Sources/MapboxMaps/Foundation/MapView.swift @@ -520,12 +520,12 @@ open class MapView: UIView, SizeTrackingLayerDelegate { // Metal is unavailable on older simulators guard ProcessInfo().isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 13, minorVersion: 0, patchVersion: 0)) else { - Log.warning(forMessage: "Metal rendering is not supported on iOS versions < iOS 13. Please test on device or on iOS simulators version >= 13.", category: "MapView") + Log.warning("Metal rendering is not supported on iOS versions < iOS 13. Please test on device or on iOS simulators version >= 13.", category: "MapView") return } // Metal is unavailable for a different reason - Log.error(forMessage: "No suitable Metal simulator can be found.", category: "MapView") + Log.error("No suitable Metal simulator can be found.", category: "MapView") #endif } @@ -576,7 +576,7 @@ open class MapView: UIView, SizeTrackingLayerDelegate { if metalView.contentScaleFactor != pixelRatio { // DrawableSize setter will recalculate `contentScaleFactor` if the new drawableSize doesn't fit into // the current bounds.size and scale. - Log.error(forMessage: "MetalView content scale factor \(metalView.contentScaleFactor) is not equal to pixel ratio \(pixelRatio)") + Log.error("MetalView content scale factor \(metalView.contentScaleFactor) is not equal to pixel ratio \(pixelRatio)") } // GL-Native will trigger update on `mapboxMap.size` update but it will come in the next frame. diff --git a/Sources/MapboxMaps/Foundation/SizeTrackingLayer.swift b/Sources/MapboxMaps/Foundation/SizeTrackingLayer.swift index 88b994f186e1..0d66851844f0 100644 --- a/Sources/MapboxMaps/Foundation/SizeTrackingLayer.swift +++ b/Sources/MapboxMaps/Foundation/SizeTrackingLayer.swift @@ -21,8 +21,6 @@ class SizeTrackingLayer: CALayer { private var sizeAnimationIsActive = false - private let loggerCategory = "SizeTrackingLayer" - override func add(_ anim: CAAnimation, forKey key: String?) { if anim.isAnimatingBounds { sizeAnimationIsActive = true @@ -32,13 +30,13 @@ class SizeTrackingLayer: CALayer { override var bounds: CGRect { didSet { - Log.debug(forMessage: """ + Log.debug(""" \(SizeTrackingLayer.self) did resize Layer: \(self) Old size: \(oldValue.size) New size: \(bounds.size) Animation is \(sizeAnimationIsActive ? "" : "NOT ")active - """, category: loggerCategory) + """, category: .sizeTrackingLayer) guard oldValue.size != bounds.size else { return } guard sizeAnimationIsActive else { sizeTrackingDelegate?.sizeTrackingLayer(layer: self, completeResizingFrom: oldValue.size, to: bounds.size) @@ -51,22 +49,22 @@ class SizeTrackingLayer: CALayer { // In case there were more than one resizing in the same animation period, the last resizing should win // CATransaction completionBlock's get called in the reverse mode. guard self.bounds.size == bounds.size else { - Log.debug(forMessage: """ + Log.debug(""" Skipping bounds resize completion of \(self) due to mismatched bounds. Layer: \(self) Old size: \(oldValue.size) Expected size: \(bounds.size) Actual size: \(self.bounds.size) - """, category: loggerCategory) + """, category: .sizeTrackingLayer) return } - Log.debug(forMessage: """ + Log.debug(""" \(SizeTrackingLayer.self) animation completed layer: \(self) Old size: \(oldValue.size) New size: \(bounds.size) - """, category: loggerCategory) + """, category: .sizeTrackingLayer) self.sizeTrackingDelegate?.sizeTrackingLayer(layer: self, completeResizingFrom: oldValue.size, to: bounds.size) @@ -95,3 +93,7 @@ extension CAAnimation { } } } + +extension Log.Category { + static let sizeTrackingLayer = Log.Category("SizeTrackingLayer") +} diff --git a/Sources/MapboxMaps/Foundation/Tracing.swift b/Sources/MapboxMaps/Foundation/Tracing.swift index 9b2ad8e1e969..8d83c859558d 100644 --- a/Sources/MapboxMaps/Foundation/Tracing.swift +++ b/Sources/MapboxMaps/Foundation/Tracing.swift @@ -76,7 +76,7 @@ public struct Tracing: OptionSet { switch component { case "core": tracing.insert(.core) case "platform": tracing.insert(.platform) - default: Log.info(forMessage: "Unrecognized tracing option: \(component)", category: "Tracing") + default: Log.info("Unrecognized tracing option: \(component)", category: "Tracing") } }) } diff --git a/Sources/MapboxMaps/Location/AppleLocationProvider.swift b/Sources/MapboxMaps/Location/AppleLocationProvider.swift index 63a3037eb2db..d2b4144ae71e 100644 --- a/Sources/MapboxMaps/Location/AppleLocationProvider.swift +++ b/Sources/MapboxMaps/Location/AppleLocationProvider.swift @@ -340,7 +340,7 @@ extension AppleLocationProvider: CLLocationManagerDelegateProxyDelegate { #endif public func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { - Log.error(forMessage: "\(self) did fail with error: \(error)", category: "Location") + Log.error("\(self) did fail with error: \(error)", category: "Location") delegate?.appleLocationProvider(self, didFailWithError: error) } diff --git a/Sources/MapboxMaps/Location/Puck/Puck2DRenderer.swift b/Sources/MapboxMaps/Location/Puck/Puck2DRenderer.swift index 327fd9c20afc..8111c11434d9 100644 --- a/Sources/MapboxMaps/Location/Puck/Puck2DRenderer.swift +++ b/Sources/MapboxMaps/Location/Puck/Puck2DRenderer.swift @@ -13,7 +13,7 @@ final class Puck2DRenderer: PuckRenderer { if state == nil { stopRendering() } - } catch { Log.error(forMessage: "Failed to update Puck2D Layer properties, \(error)") } + } catch { Log.error("Failed to update Puck2D Layer properties, \(error)") } } } @@ -57,7 +57,7 @@ final class Puck2DRenderer: PuckRenderer { displayLinkToken = displayLink.observe { [weak self] in do { try self?.renderPulsing() - } catch { Log.error(forMessage: "Failed to render pulsing animation, \(error)") } + } catch { Log.error("Failed to render pulsing animation, \(error)") } } } } diff --git a/Sources/MapboxMaps/Location/Puck/Puck3DRenderer.swift b/Sources/MapboxMaps/Location/Puck/Puck3DRenderer.swift index 7304a2e6482c..f7994ae571a0 100644 --- a/Sources/MapboxMaps/Location/Puck/Puck3DRenderer.swift +++ b/Sources/MapboxMaps/Location/Puck/Puck3DRenderer.swift @@ -38,7 +38,7 @@ final class Puck3DRenderer: PuckRenderer { .flatMap { orientation -> [Double]? in guard orientation.count == 3 else { Log.warning( - forMessage: "Puck3DConfiguration.model.orientation?.count must be 3 or nil. Actual orientation is \(orientation). Resetting it to [0, 0, 0].", + "Puck3DConfiguration.model.orientation?.count must be 3 or nil. Actual orientation is \(orientation). Resetting it to [0, 0, 0].", category: "Puck") return nil } @@ -69,7 +69,7 @@ final class Puck3DRenderer: PuckRenderer { try style.addSource(source) } } catch { - Log.error(forMessage: "Failed to update Puck3D Source properties, \(error)") + Log.error("Failed to update Puck3D Source properties, \(error)") } } @@ -106,7 +106,7 @@ final class Puck3DRenderer: PuckRenderer { try style.moveLayer(withId: Self.layerID, to: newConfiguration.layerPosition ?? .default) } } catch { - Log.error(forMessage: "Failed to update Puck3D Layer properties, \(error)") + Log.error("Failed to update Puck3D Layer properties, \(error)") } } } diff --git a/Sources/MapboxMaps/Ornaments/InfoButtonOrnament.swift b/Sources/MapboxMaps/Ornaments/InfoButtonOrnament.swift index 729d4c4de41d..6542184642bb 100644 --- a/Sources/MapboxMaps/Ornaments/InfoButtonOrnament.swift +++ b/Sources/MapboxMaps/Ornaments/InfoButtonOrnament.swift @@ -10,7 +10,7 @@ internal class InfoButtonOrnament: UIView { public override var isHidden: Bool { didSet { if isHidden { - Log.warning(forMessage: "Attribution must be enabled if you use data from sources that require it. See https://docs.mapbox.com/help/getting-started/attribution/ for more details.", category: "Ornaments") + Log.warning("Attribution must be enabled if you use data from sources that require it. See https://docs.mapbox.com/help/getting-started/attribution/ for more details.", category: "Ornaments") } } } diff --git a/Sources/MapboxMaps/Ornaments/LogoView.swift b/Sources/MapboxMaps/Ornaments/LogoView.swift index e3f61388840c..901fa06814ac 100644 --- a/Sources/MapboxMaps/Ornaments/LogoView.swift +++ b/Sources/MapboxMaps/Ornaments/LogoView.swift @@ -47,7 +47,7 @@ internal class LogoView: UIView { public override var isHidden: Bool { didSet { if isHidden { - Log.warning(forMessage: "The Mapbox logo wordmark must remain enabled in accordance with our Terms of Service. See https://www.mapbox.com/legal/tos for more details.", category: "Ornaments") + Log.warning("The Mapbox logo wordmark must remain enabled in accordance with our Terms of Service. See https://www.mapbox.com/legal/tos for more details.", category: "Ornaments") } } } diff --git a/Sources/MapboxMaps/Style/AttributionDialogManager.swift b/Sources/MapboxMaps/Style/AttributionDialogManager.swift index 9506eac0f2d0..4093be81c987 100644 --- a/Sources/MapboxMaps/Style/AttributionDialogManager.swift +++ b/Sources/MapboxMaps/Style/AttributionDialogManager.swift @@ -26,7 +26,7 @@ final class AttributionDialogManager { isGeofenceActive: @escaping () -> Bool = { __GeofencingUtils.isActive() }, setGeofenceConsent: @escaping (Bool) -> Void = { isConsentGiven in __GeofencingUtils.setUserConsent(isConsentGiven: isConsentGiven, callback: { expected in - if let error = expected.error { Log.error(forMessage: "Error: \(error) occurred while changing user consent for Geofencing.") } + if let error = expected.error { Log.error("Error: \(error) occurred while changing user consent for Geofencing.") } }) }, getGeofenceConsent: @escaping () -> Bool = { __GeofencingUtils.getUserConsent() } @@ -122,7 +122,7 @@ extension AttributionDialogManager: InfoButtonOrnamentDelegate { private func showAttributionDialog(for attributions: [Attribution]) { guard let viewController = delegate?.viewControllerForPresenting(self) else { - Log.error(forMessage: "Failed to present an attribution dialogue: no presenting view controller found.") + Log.error("Failed to present an attribution dialogue: no presenting view controller found.") return } diff --git a/Sources/MapboxMaps/Style/ModelSource.swift b/Sources/MapboxMaps/Style/ModelSource.swift index 91f55374f70c..b0e786380836 100644 --- a/Sources/MapboxMaps/Style/ModelSource.swift +++ b/Sources/MapboxMaps/Style/ModelSource.swift @@ -28,7 +28,7 @@ public struct Model: Equatable, Codable, Sendable { extension Model: MapStyleContent, PrimitiveMapContent { func visit(_ node: MapContentNode) { guard id != nil, uri != nil else { - Log.warning(forMessage: "Failed to add Model to StyleModel because it does not have an id or uri.", category: "styleDSL") + Log.warning("Failed to add Model to StyleModel because it does not have an id or uri.", category: "styleDSL") return } node.mount(MountedModel(model: self)) diff --git a/Sources/MapboxMaps/Style/StyleSourceManager.swift b/Sources/MapboxMaps/Style/StyleSourceManager.swift index 5e030d4560f7..67e37e2882fa 100644 --- a/Sources/MapboxMaps/Style/StyleSourceManager.swift +++ b/Sources/MapboxMaps/Style/StyleSourceManager.swift @@ -117,7 +117,7 @@ internal final class StyleSourceManager: StyleSourceManagerProtocol { features: features.map(MapboxCommon.Feature.init)) } } catch { - Log.error(forMessage: "Failed to add features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") + Log.error("Failed to add features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") } } item.notify(queue: .main) { [weak self] in @@ -174,7 +174,7 @@ internal final class StyleSourceManager: StyleSourceManagerProtocol { features: features.map(MapboxCommon.Feature.init)) } } catch { - Log.error(forMessage: "Failed to update features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") + Log.error("Failed to update features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") } } item.notify(queue: .main) { [weak self] in @@ -196,7 +196,7 @@ internal final class StyleSourceManager: StyleSourceManagerProtocol { featureIds: featureIds) } } catch { - Log.error(forMessage: "Failed to remove features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") + Log.error("Failed to remove features for source with id: \(sourceId), dataId: \(dataId ?? ""), error: \(error)") } } item.notify(queue: .main) { [weak self] in @@ -301,7 +301,7 @@ internal final class StyleSourceManager: StyleSourceManagerProtocol { do { try self?.setStyleGeoJSONSourceDataForSourceId(id, dataId: dataId, data: data) } catch { - Log.error(forMessage: "Failed to set data for source with id: \(id), error: \(error)") + Log.error("Failed to set data for source with id: \(id), error: \(error)") } } diff --git a/Sources/MapboxMaps/Style/Types/ExpressionArgumentBuilder.swift b/Sources/MapboxMaps/Style/Types/ExpressionArgumentBuilder.swift index 806942101894..41bd08afa0b3 100644 --- a/Sources/MapboxMaps/Style/Types/ExpressionArgumentBuilder.swift +++ b/Sources/MapboxMaps/Style/Types/ExpressionArgumentBuilder.swift @@ -68,7 +68,7 @@ extension Array: ExpressionArgumentConvertible { } else if let validNumberArray = self as? [Double] { return [.numberArray(validNumberArray)] } else { - Log.warning(forMessage: "Unsupported array provided to Expression. Only [String] and [Double] are supported.", category: "Expressions") + Log.warning("Unsupported array provided to Expression. Only [String] and [Double] are supported.", category: "Expressions") return [] } } diff --git a/Sources/MapboxMaps/Style/Types/GeoJSONSourceData.swift b/Sources/MapboxMaps/Style/Types/GeoJSONSourceData.swift index a52dd0f62ec9..7580cb0a8854 100644 --- a/Sources/MapboxMaps/Style/Types/GeoJSONSourceData.swift +++ b/Sources/MapboxMaps/Style/Types/GeoJSONSourceData.swift @@ -102,7 +102,7 @@ extension GeoJSONObject { return .featureCollection(collection) #if USING_TURF_WITH_LIBRARY_EVOLUTION @unknown default: - Log.info(forMessage: "Unexpected \(GeoJSONObject.self) type: \(self)") + Log.info("Unexpected \(GeoJSONObject.self) type: \(self)") return .featureCollection(FeatureCollection(features: [])) #endif } diff --git a/Sources/MapboxMaps/Style/Types/StyleColor.swift b/Sources/MapboxMaps/Style/Types/StyleColor.swift index 2043aebc1b35..df6438ec86e8 100644 --- a/Sources/MapboxMaps/Style/Types/StyleColor.swift +++ b/Sources/MapboxMaps/Style/Types/StyleColor.swift @@ -93,7 +93,7 @@ public struct StyleColor: Codable, Hashable, Sendable, RawRepresentable, Express blue = components[2] alpha = components[3] } else { - Log.error(forMessage: "Failed to convert the color \(color) to sRGB color space. Falling back to black.") + Log.error("Failed to convert the color \(color) to sRGB color space. Falling back to black.") } self.rawValue = String(format: "rgba(%.2f, %.2f, %.2f, %.2f)", red * 255, green * 255, blue * 255, alpha) diff --git a/Sources/MapboxMaps/SwiftUI/Annotations/AnnotationClusterGestureContext.swift b/Sources/MapboxMaps/SwiftUI/Annotations/AnnotationClusterGestureContext.swift index c070aad515f8..4488147e88d2 100644 --- a/Sources/MapboxMaps/SwiftUI/Annotations/AnnotationClusterGestureContext.swift +++ b/Sources/MapboxMaps/SwiftUI/Annotations/AnnotationClusterGestureContext.swift @@ -30,7 +30,7 @@ extension MapFeatureQueryable { completion(.success(context)) case let .failure(error): - Log.warning(forMessage: "Failed to query map annotation cluster gesture: \(error)", category: "Gestures") + Log.warning("Failed to query map annotation cluster gesture: \(error)", category: "Gestures") completion(.failure(error)) } } diff --git a/Sources/MapboxMaps/SwiftUI/MapViewFacade.swift b/Sources/MapboxMaps/SwiftUI/MapViewFacade.swift index de0f0df5c2c3..7889e7e501c4 100644 --- a/Sources/MapboxMaps/SwiftUI/MapViewFacade.swift +++ b/Sources/MapboxMaps/SwiftUI/MapViewFacade.swift @@ -52,7 +52,7 @@ private extension MapView { if clampedRange != initialRange { Log.warning( - forMessage: """ + """ Provided frame rate range was clamped from \(initialRange) to \(clampedRange). Negative or zero values are not allowed. """, @@ -70,7 +70,7 @@ private extension MapView { if clampedValue != preferred { Log.warning( - forMessage: """ + """ Preferred frame rate was clamped from \(preferred) to \(clampedValue). Negative value, zero values and values larger then Int.max are not allowed. """, diff --git a/Sources/MapboxMaps/SwiftUI/Util/Util.swift b/Sources/MapboxMaps/SwiftUI/Util/Util.swift index 77ebba60b42e..2d7569b129a0 100644 --- a/Sources/MapboxMaps/SwiftUI/Util/Util.swift +++ b/Sources/MapboxMaps/SwiftUI/Util/Util.swift @@ -12,7 +12,7 @@ func wrapAssignError(_ body: () throws -> Void) { do { try body() } catch { - Log.error(forMessage: "Failed to assign property, error: \(error)", category: "SwiftUI") + Log.error("Failed to assign property, error: \(error)", category: "SwiftUI") } }