Skip to content

Commit 43a076f

Browse files
committed
logs: move some logs to the correct tab
1 parent db8ea5d commit 43a076f

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

InfiniLink/BLE/BLEFS.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class BLEFSHandler: ObservableObject {
100100
@Published var externalResourcesSize: Int = 0
101101

102102
func uploadExternalResources(completion: @escaping() -> Void) {
103-
log("External resource upload requested", type: .info, caller: "BLEFSHandler")
103+
log("External resource upload requested", type: .info, caller: "BLEFSHandler", target: .ble)
104104

105105
DispatchQueue.global(qos: .default).async { [self] in
106106
do {
@@ -163,7 +163,7 @@ class BLEFSHandler: ObservableObject {
163163
}
164164

165165
private func createDir(path: String) {
166-
log("Create directory called", type: .info, caller: "BLEFSHandler")
166+
log("Create directory called", type: .info, caller: "BLEFSHandler", target: .ble)
167167

168168
let dir = path.components(separatedBy: "/").filter { $0 != "" }
169169

@@ -182,7 +182,7 @@ class BLEFSHandler: ObservableObject {
182182
}
183183

184184
func readFile(path: String, offset: UInt32) -> ReadFileFS {
185-
log("Read file called", type: .info, caller: "BLEFSHandler")
185+
log("Read file called", type: .info, caller: "BLEFSHandler", target: .ble)
186186

187187
var writeData = Data()
188188

@@ -226,7 +226,7 @@ class BLEFSHandler: ObservableObject {
226226
}
227227

228228
func writeFile(data: Data, path: String, offset: UInt32) -> WriteFileFS {
229-
log("Write file called", type: .info, caller: "BLEFSHandler")
229+
log("Write file called", type: .info, caller: "BLEFSHandler", target: .ble)
230230

231231
var write = WriteFileFS()
232232
write.group = DispatchGroup()
@@ -305,7 +305,7 @@ class BLEFSHandler: ObservableObject {
305305
}
306306

307307
func deleteFile(path: String) -> Bool {
308-
log("Delete file called", type: .info, caller: "BLEFSHandler")
308+
log("Delete file called", type: .info, caller: "BLEFSHandler", target: .ble)
309309

310310
var rm = InformationFS()
311311
rm.group = DispatchGroup()
@@ -331,7 +331,7 @@ class BLEFSHandler: ObservableObject {
331331
}
332332

333333
func makeDir(path: String) -> Bool {
334-
log("Make directory called", type: .info, caller: "BLEFSHandler")
334+
log("Make directory called", type: .info, caller: "BLEFSHandler", target: .ble)
335335

336336
var mk = InformationFS()
337337
mk.group = DispatchGroup()
@@ -364,7 +364,7 @@ class BLEFSHandler: ObservableObject {
364364
}
365365

366366
func listDir(path: String) -> DirList {
367-
log("List directory called", type: .info, caller: "BLEFSHandler")
367+
log("List directory called", type: .info, caller: "BLEFSHandler", target: .ble)
368368

369369
var ls = InformationFS()
370370
ls.group = DispatchGroup()
@@ -391,7 +391,7 @@ class BLEFSHandler: ObservableObject {
391391
}
392392

393393
func moveFileOrDir(oldPath: String, newPath: String) -> Bool {
394-
log("Move file/directory called", type: .info, caller: "BLEFSHandler")
394+
log("Move file/directory called", type: .info, caller: "BLEFSHandler", target: .ble)
395395

396396
var mv = InformationFS()
397397
mv.group = DispatchGroup()
@@ -602,7 +602,7 @@ class BLEFSHandler: ObservableObject {
602602
}
603603

604604
func readSettings(completion: @escaping(Settings) -> Void) {
605-
log("Settings requested", type: .info, caller: "BLEFSHandler")
605+
log("Settings requested", type: .info, caller: "BLEFSHandler", target: .ble)
606606

607607
DispatchQueue.global(qos: .default).async {
608608
let readFile = self.readFile(path: "/settings.dat", offset: 0)

InfiniLink/BLE/BLEWriteManager.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@ struct BLEWriteManager {
2222
return
2323
}
2424
bleManager.infiniTime.writeValue(writeData, for: characteristic, type: .withResponse)
25-
log("Wrote to music app", type: .info, caller: "BLEWriteManager")
25+
log("Wrote to music app", type: .info, caller: "BLEWriteManager", target: .ble)
2626
}
2727

2828
func writeHexToMusicApp(message: [UInt8], characteristic: CBCharacteristic) -> Void {
2929
guard bleManager.infiniTime != nil else { return }
3030
let writeData = Data(bytes: message, count: message.capacity)
3131

3232
bleManager.infiniTime.writeValue(writeData, for: characteristic, type: .withResponse)
33-
log("Wrote to music app", type: .info, caller: "BLEWriteManager")
33+
log("Wrote to music app", type: .info, caller: "BLEWriteManager", target: .ble)
3434
}
3535

3636
func setTime(characteristic: CBCharacteristic) {
3737
guard bleManager.infiniTime != nil else { return }
3838

3939
do {
4040
try bleManager.infiniTime.writeValue(SetTime().currentTime().hexData, for: characteristic, type: .withResponse)
41-
log("Set watch time", type: .info, caller: "BLEWriteManager")
41+
log("Set watch time", type: .info, caller: "BLEWriteManager", target: .ble)
4242
} catch {
4343
bleManager.setTimeError = true
44-
log("Error setting watch time", caller: "BLEWriteManager")
44+
log("Error setting watch time", caller: "BLEWriteManager", target: .ble)
4545
}
4646
}
4747

@@ -56,7 +56,7 @@ struct BLEWriteManager {
5656

5757
if !notification.isEmpty && watchNotifications {
5858
bleManager.infiniTime.writeValue(notification, for: bleManager.notifyCharacteristic, type: .withResponse)
59-
log("Notification sent with title: \(notif.title)", caller: "BLEWriteManager")
59+
log("Notification sent with title: \(notif.title)", caller: "BLEWriteManager", target: .ble)
6060
}
6161
}
6262

@@ -70,7 +70,7 @@ struct BLEWriteManager {
7070

7171
if notification.count > 0 && watchNotifications {
7272
bleManager.infiniTime.writeValue(notification, for: bleManager.notifyCharacteristic, type: .withResponse)
73-
log("Sent lost notification", type: .info, caller: "BLEWriteManager")
73+
log("Sent lost notification", type: .info, caller: "BLEWriteManager", target: .ble)
7474
}
7575
}
7676

@@ -97,7 +97,7 @@ struct BLEWriteManager {
9797
}
9898

9999
if locationData.count > 32 {
100-
log("Weather location string is too big to send", caller: "BLEWriteManager")
100+
log("Weather location string is too big to send", caller: "BLEWriteManager", target: .ble)
101101
for _ in 1...32 {bytes.append(0)}
102102
} else {
103103
for _ in 1...32-locationData.count {locationData.append(0)}
@@ -108,7 +108,7 @@ struct BLEWriteManager {
108108
let writeData = Data(bytes: bytes as [UInt8], count: 49)
109109
if bleManager.weatherCharacteristic != nil && bleManager.infiniTime != nil {
110110
bleManager.infiniTime.writeValue(writeData, for: bleManager.weatherCharacteristic, type: .withResponse)
111-
log("Set watch current weather", type: .info, caller: "BLEWriteManager")
111+
log("Set watch current weather", type: .info, caller: "BLEWriteManager", target: .ble)
112112
}
113113
}
114114

@@ -140,7 +140,7 @@ struct BLEWriteManager {
140140

141141
if bleManager.weatherCharacteristic != nil && bleManager.infiniTime != nil {
142142
bleManager.infiniTime.writeValue(writeData, for: bleManager.weatherCharacteristic, type: .withResponse)
143-
log("Set watch forecast", type: .info, caller: "BLEWriteManager")
143+
log("Set watch forecast", type: .info, caller: "BLEWriteManager", target: .ble)
144144
}
145145
}
146146

@@ -160,7 +160,7 @@ struct BLEWriteManager {
160160
bleManager.infiniTime.writeValue(progress, for: bleManager.navigationProgressCharacteristic, type: .withResponse)
161161
bleManager.infiniTime.writeValue(icon, for: bleManager.navigationFlagsCharacteristic, type: .withResponse)
162162

163-
log("Wrote navigation update", type: .info, caller: "BLEWriteManager")
163+
log("Wrote navigation update", type: .info, caller: "BLEWriteManager", target: .ble)
164164
}
165165
}
166166

0 commit comments

Comments
 (0)