     /// Custom message
     public let message: String
     
+    private var threadName: String {
+        if thread.isMainThread {
+            return "Main"
+        } else if let name = thread.name where !name.isEmpty {
+            return name
+        } else {
+            return String(format:"%p", thread)
+        }
+    }
+    
     // MARK: Init
     
     private init(thread: NSThread, file: String, line: Int, function: String, message: String) {

    /// Concatenated text representation of a complete log line
    public var description: String {
        let date = AELog.sharedInstance.settings.dateFormatter.stringFromDate(self.date)
        let threadName = (self.thread.name ?? "Unknown").isEmpty ? "Unknown" : self.thread.name!
        let thread = self.thread.isMainThread ? "Main" : threadName
        let desc = parse(date: date, thread: thread, file: file, line: line, function: function, message: message)
        return desc
    }
    

    }
    
    private func log(thread thread: NSThread, path: String, line: Int, function: String, message: String) {
        dispatch_async(logQueue) { [unowned self] in
            if self.settings.enabled {
                let file = self.fileNameForPath(path)
                if self.fileEnabled(file) {
