Meshtastic-Apple/Meshtastic/Extensions/OSLogEntryLog.swift

36 lines
728 B
Swift
Raw Normal View History

//
// OSLogEntryLog.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 6/28/24.
//
import OSLog
import SwiftUI
/// Extensions to allow rendering of the emoji string and log leve coloring in the grid of OSLogEntryLog items
extension OSLogEntryLog.Level {
var description: String {
switch self {
case .undefined: "undefined"
case .debug: "🪲 Debug"
case .info: " Info"
case .notice: "⚠️ Notice"
case .error: "🚨 Error"
2024-06-28 22:07:52 -07:00
case .fault: "💥 Fault"
@unknown default: "default"
}
}
var color: Color {
switch self {
case .undefined: .green
case .debug: .indigo
case .info: .green
case .notice: .orange
case .error: .red
case .fault: .red
@unknown default: .green
}
}
}