     let restDelay = 5.0
 
     let clock: (() -> Double)
-    var errors: [String]
+    let errorLog: ErrorLog
     let id: String
     let state: File
     var metaDowns = [Int]()
     var fadeUntil = 0.0
     var mayGo = false
     var updated = false
-    
+
     func setMeters(newList: [MeterData]) {
         var olds = [String:Meter]()
         for m in meters {

        var e: NSError?
        let r = NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions(0), error: &e)
        if r == nil {
            return warn.with("Invalid pattern <\(pattern)> or template <\(template)>")
        }
        let s = r!.stringByReplacingMatchesInString(path, options: NSMatchingOptions(0), range: NSMakeRange(0, path.utf16Count), withTemplate: template)
        if rename(path, s) != 0 {
            return warn.withErrno("Couldn't rename <\(path)> to <\(s)>")
        }
        return true
    }
}

func makeSystemFile(path: String?, mode: String) -> File {
    return path == nil ? File() : SystemFile(path: path!, mode: mode)
}

enum Action {

    }

    func applicationDidFinishLaunching(aNotification: NSNotification) {
        item = NSStatusBar.systemStatusBar().statusItemWithLength(/* NSVariableStatusItemLength */ -1)
        let prompt: String = kAXTrustedCheckOptionPrompt.takeUnretainedValue()
        let trusted = AXIsProcessTrustedWithOptions([prompt: true]) != 0
        if item == nil || !trusted {
            NSApplication.sharedApplication().terminate(nil)
            return
        }
        
        let errorLog = ErrorLog()
        var root : String? = "~/Library/Application Support/Ergometer".stringByStandardizingPath
        var e : NSError?
        if !NSFileManager.defaultManager().createDirectoryAtPath(root!, withIntermediateDirectories: true, attributes: nil, error: &e) {
            root = nil
            errorLog.warn("Couldn't create <\(root)>" + (e != nil ? ": " + e!.localizedDescription : ""))
        }
        
        app = App(clock: systemClock, makeFile: makeSystemFile, root: root, errorLog: errorLog)
        tick()
        let mask : NSEventMask =
            .KeyDownMask |
            .FlagsChangedMask |
