The Xcode console logs an identifier indicating the current thread that's running when a message is print()
ed from Swift. Some more complex logging systems (e.g. swift-log and console-kit) don't provide that information, and I'm trying to write a logging back-end for swift-log that will.
Thing is, I don't see any way to get the current queue name in Swift. I tried
dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)
But I get "cannot convert value of type '()' to expected argument type 'DispatchQueue?'". Passing nil
instead results in "'dispatch_queue_get_label' has been replaced by property 'DispatchQueue.label'".
This is not an unreasonable thing to want to do, and it poses no safety concerns.