mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #659 from meshtastic/2.3.10_Working_Changes
Add the mesh log to the logger
This commit is contained in:
commit
2360d9f19a
3 changed files with 4 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ extension Logger {
|
|||
|
||||
/// All logs related to data such as decoding error, parsing issues, etc.
|
||||
static let data = Logger(subsystem: subsystem, category: "🗄️ Data")
|
||||
|
||||
|
||||
/// All logs related to the mesh
|
||||
static let mesh = Logger(subsystem: subsystem, category: "🕸️ Mesh")
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class MeshLogger {
|
|||
fileHandle.closeFile()
|
||||
} else {
|
||||
try data.write(to: logFile, options: .atomicWrite)
|
||||
let log = String(data: data, encoding: .utf8) ?? "unknown".localized
|
||||
Logger.mesh.notice("\(log)")
|
||||
}
|
||||
} catch {
|
||||
Logger.mesh.error("Error writing mesh log data: \(error.localizedDescription)")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct MeshLog: View {
|
|||
let url = logFile!
|
||||
logs.removeAll()
|
||||
var lineCount = 0
|
||||
let lineLimit = 500
|
||||
let lineLimit = 5000
|
||||
// Get the number of lines
|
||||
for try await _ in url.lines {
|
||||
lineCount += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue