mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Adopt OSLog for logging and replace the majority of calls to print()
This commit is contained in:
parent
79e23d561e
commit
4c7cd0d923
65 changed files with 418 additions and 401 deletions
|
|
@ -83,7 +83,7 @@ class LocalMBTileOverlay: MKTileOverlay {
|
|||
self._boundingMapRect = MKMapRect(coordinates: coords)
|
||||
|
||||
} catch {
|
||||
print("💥 Map tile error: \(error)")
|
||||
logger.error("Map tile error: \(error)")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ class LocalMBTileOverlay: MKTileOverlay {
|
|||
let data = Data(bytes: dataQuery[tileData].bytes, count: dataQuery[tileData].bytes.count)// dataQuery![tileData].bytes
|
||||
result(data, nil)
|
||||
} else {
|
||||
print("💥 No tile here: x:\(tileX) y:\(tileY) z:\(tileZ)")
|
||||
logger.error("No tile here: x:\(tileX) y:\(tileY) z:\(tileZ)")
|
||||
let error = NSError(domain: "LocalMBTileOverlay", code: 1, userInfo: ["reason": "no_tile"])
|
||||
result(nil, error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,13 +144,13 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first!
|
||||
let tilePath = documentsDirectory.appendingPathComponent("offline_map.mbtiles", isDirectory: false).path
|
||||
if fileManager.fileExists(atPath: tilePath) {
|
||||
print("Loading local map file")
|
||||
logger.info("Loading local map file")
|
||||
if let overlay = LocalMBTileOverlay(mbTilePath: tilePath) {
|
||||
overlay.canReplaceMapContent = false// customMapOverlay.canReplaceMapContent
|
||||
mapView.addOverlay(overlay)
|
||||
}
|
||||
} else {
|
||||
print("Couldn't find a local map file to load")
|
||||
logger.info("Couldn't find a local map file to load")
|
||||
}
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
|
|
@ -209,7 +209,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
}
|
||||
let annotationCount = waypoints.count + (showNodeHistory ? positions.count : latest.count)
|
||||
if annotationCount != mapView.annotations.count {
|
||||
print("Annotation Count: \(annotationCount) Map Annotations: \(mapView.annotations.count)")
|
||||
logger.info("Annotation Count: \(annotationCount) Map Annotations: \(mapView.annotations.count)")
|
||||
mapView.removeAnnotations(mapView.annotations)
|
||||
mapView.addAnnotations(waypoints)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ struct NodeMapMapkit: View {
|
|||
attributionLogo = colorScheme == .light ? attribution.combinedMarkLightURL : attribution.combinedMarkDarkURL
|
||||
}
|
||||
} catch {
|
||||
print("Could not gather weather information...", error.localizedDescription)
|
||||
logger.error("Could not gather weather information: \(error.localizedDescription)")
|
||||
condition = .clear
|
||||
symbolName = "cloud.fill"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ struct WaypointFormMapKit: View {
|
|||
dismiss()
|
||||
} else {
|
||||
dismiss()
|
||||
print("Send waypoint failed")
|
||||
logger.error("Send waypoint failed")
|
||||
}
|
||||
} label: {
|
||||
Label("Send", systemImage: "arrow.up")
|
||||
|
|
@ -212,7 +212,7 @@ struct WaypointFormMapKit: View {
|
|||
dismiss()
|
||||
} else {
|
||||
dismiss()
|
||||
print("Send waypoint failed")
|
||||
logger.error("Send waypoint failed")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue