Skip to content

Commit

Permalink
Fix loading log
Browse files Browse the repository at this point in the history
  • Loading branch information
uhooi committed Aug 29, 2024
1 parent ea7562f commit caf259c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macSKK/Settings/LogView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import OSLog
import SwiftUI

@MainActor
struct LogView: View {
@State var log: String
@State private var loading: Bool = false
Expand Down Expand Up @@ -32,7 +33,7 @@ struct LogView: View {
.task {
loading = true
do {
self.log = try load()
self.log = try await load()
} catch {
self.log = "アプリケーションログが取得できません: \(error)"
logger.error("アプリケーションログが取得できません: \(error)")
Expand All @@ -41,7 +42,7 @@ struct LogView: View {
}
}

private func load() throws -> String {
nonisolated private func load() async throws -> String {
func levelDescription(level: OSLogEntryLog.Level) -> String {
switch level {
case .undefined:
Expand Down

0 comments on commit caf259c

Please sign in to comment.