From 1575a8c9c508bf67314e419ab0407e48c197b32d Mon Sep 17 00:00:00 2001 From: Tim Bert <5411131+timbms@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:59:39 +0100 Subject: [PATCH] Remove LogsViewer.swift in openHABWatch/Views/Rows Signed-off-by: Tim Bert <5411131+timbms@users.noreply.github.com> --- openHABWatch/Views/Rows/LogsViewer.swift | 43 ------------------------ 1 file changed, 43 deletions(-) delete mode 100644 openHABWatch/Views/Rows/LogsViewer.swift diff --git a/openHABWatch/Views/Rows/LogsViewer.swift b/openHABWatch/Views/Rows/LogsViewer.swift deleted file mode 100644 index 4a0944d8..00000000 --- a/openHABWatch/Views/Rows/LogsViewer.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// LogView.swift -// openHABWatch -// -// Created by Tim Müller-Seydlitz on 31.10.24. -// Copyright © 2024 openHAB e.V. All rights reserved. -// - -import Foundation -import OSLog -import SwiftUI - -struct LogsViewer: View { - let logs: [OSLogEntryLog] - - init() { - let logStore = try! OSLogStore(scope: .currentProcessIdentifier) - self.logs = try! logStore.getEntries().compactMap { entry in - guard let logEntry = entry as? OSLogEntryLog, - logEntry.subsystem.starts(with: "com.donnywals") == true else { - return nil - } - - return logEntry - } - } - - var body: some View { - List(logs, id: \.self) { log in - VStack(alignment: .leading) { - Text(log.composedMessage) - HStack { - Text(log.subsystem) - Text(log.date, format: .dateTime) - }.bold() - } - } - } -} - -#Preview { - LogsViewer() -}