You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
793 B
39 lines
793 B
//
|
|
// LogsView.swift
|
|
// LeCountdown
|
|
//
|
|
// Created by Laurent Morvillier on 10/04/2023.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct LogsView: View {
|
|
var body: some View {
|
|
List {
|
|
ForEach(FileLogger.main.logs.reversed()) { log in
|
|
LogView(log: log)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct LogView: View {
|
|
|
|
var log: Log
|
|
|
|
var body: some View {
|
|
|
|
VStack(alignment: .leading) {
|
|
Text(log.date.formattedDateTime)
|
|
.foregroundColor(.gray)
|
|
Text(log.content)
|
|
}.font(.footnote)
|
|
}
|
|
}
|
|
|
|
struct LogsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
LogView(log: Log(date: Date(), file: "text.txt", line: 100, function: "test()", message: "crazy stuff here"))
|
|
}
|
|
}
|
|
|