     /// 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) {

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

    private static let sharedInstance = AELog()
    private let settings = AELogSettings()
    private weak var delegate: AELogDelegate?
    private let logQueue = dispatch_queue_create("AELog", nil)
    
    // MARK: API

