mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Setup proper logging for MapLibre and location views.
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import Combine
|
import Combine
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import MapLibre
|
||||||
import MatrixRustSDK
|
import MatrixRustSDK
|
||||||
|
|
||||||
enum Target: String {
|
enum Target: String {
|
||||||
@@ -62,6 +63,24 @@ enum Target: String {
|
|||||||
|
|
||||||
MXLog.configure(currentTarget: rawValue)
|
MXLog.configure(currentTarget: rawValue)
|
||||||
|
|
||||||
|
MLNLoggingConfiguration.shared.loggingLevel = .debug
|
||||||
|
MLNLoggingConfiguration.shared.handler = { loggingLevel, _, _, message in
|
||||||
|
switch loggingLevel {
|
||||||
|
case .error:
|
||||||
|
MXLog.error(message)
|
||||||
|
case .warning:
|
||||||
|
MXLog.warning(message)
|
||||||
|
case .info:
|
||||||
|
MXLog.info(message)
|
||||||
|
case .debug:
|
||||||
|
MXLog.debug(message)
|
||||||
|
case .verbose:
|
||||||
|
MXLog.verbose(message)
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let hookCancellable = rageshakeURL.publisher
|
let hookCancellable = rageshakeURL.publisher
|
||||||
.sink { _ in
|
.sink { _ in
|
||||||
appHooks.tracingHook.update(tracingConfiguration, with: rageshakeURL)
|
appHooks.tracingHook.update(tracingConfiguration, with: rageshakeURL)
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ struct MapLibreStaticMapView<PinAnnotation: View>: View {
|
|||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(contentMode: .fill)
|
||||||
pinAnnotationView
|
pinAnnotationView
|
||||||
}
|
}
|
||||||
case .failure:
|
case .failure(let error):
|
||||||
|
let _ = MXLog.error("Failed retrieving tile with error: \(error.localizedDescription)")
|
||||||
errorView
|
errorView
|
||||||
@unknown default:
|
@unknown default:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
|
|||||||
Reference in New Issue
Block a user