Merge pull request #659 from meshtastic/2.3.10_Working_Changes

Add the mesh log to the logger
This commit is contained in:
Garth Vander Houwen 2024-06-03 11:15:50 -07:00 committed by GitHub
commit 2360d9f19a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -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")

View file

@ -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)")

View file

@ -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