Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
12345678910111213141516171819202122import Foundation
private let debugLogURL = URL(fileURLWithPath: "/tmp/menuband-debug.log")private let debugLogQueue = DispatchQueue(label: "menuband.debugLog")private var debugLogReady = false
func debugLog(_ message: String) { debugLogQueue.async { if !debugLogReady { try? "".write(to: debugLogURL, atomically: true, encoding: .utf8) debugLogReady = true } let line = "\(Date().timeIntervalSince1970) \(message)\n" guard let data = line.data(using: .utf8) else { return } if let fh = try? FileHandle(forWritingTo: debugLogURL) { fh.seekToEndOfFile() fh.write(data) try? fh.close() } }}