Mac: link Debug log button to pino log
This commit is contained in:
@@ -15,7 +15,8 @@ struct DebugSettings: View {
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
LabeledContent("PID") { Text("\(ProcessInfo.processInfo.processIdentifier)") }
|
||||
LabeledContent("Log file") {
|
||||
Button("Open /tmp/clawdis.log") { NSWorkspace.shared.open(URL(fileURLWithPath: "/tmp/clawdis.log")) }
|
||||
Button("Open pino log") { NSWorkspace.shared.open(URL(fileURLWithPath: self.pinoLogPath)) }
|
||||
.help(self.pinoLogPath)
|
||||
}
|
||||
LabeledContent("Binary path") { Text(Bundle.main.bundlePath).font(.footnote) }
|
||||
LabeledContent("Relay status") {
|
||||
@@ -112,6 +113,15 @@ struct DebugSettings: View {
|
||||
.task { await self.reloadModels() }
|
||||
}
|
||||
|
||||
private var pinoLogPath: String {
|
||||
let df = DateFormatter()
|
||||
df.calendar = Calendar(identifier: .iso8601)
|
||||
df.locale = Locale(identifier: "en_US_POSIX")
|
||||
df.dateFormat = "yyyy-MM-dd"
|
||||
let today = df.string(from: Date())
|
||||
return "/tmp/clawdis/clawdis-\(today).log"
|
||||
}
|
||||
|
||||
private func chooseCatalogFile() {
|
||||
let panel = NSOpenPanel()
|
||||
panel.title = "Select models.generated.ts"
|
||||
|
||||
Reference in New Issue
Block a user