HeliumLogger icon indicating copy to clipboard operation
HeliumLogger copied to clipboard

feature: log swift queue name

Open mman opened this issue 3 years ago • 3 comments

In an app using multiple dispatch queues it may be worth logging current queue with every message.

Would you be willing to accept a PR if I consider adding this support? I am using HeliumLogger in multiple server side swift projects and would be willing to open a PR.

thanks for great and simple component...

mman avatar Nov 07 '22 11:11 mman

Thanks for asking about this. Just curious how you plan to get the current queue? According to this thread, it doesn't seem like there's a good way to do this.

dannys42 avatar Nov 07 '22 19:11 dannys42

        print(String(cString: __dispatch_queue_get_label(nil)))

from here: https://developer.apple.com/forums/thread/701313

mman avatar Nov 07 '22 20:11 mman

Just to keep you updated. I have prototyped this including passing tests in my repo fork here: https://github.com/mman/HeliumLogger/commit/8f1e1ef74080fa5d00d7181dcf91b2aafc56d74b and it works great on macOS, but I was not able to make it compile under Linux. The hidden symbol __dispatch_queue_get_label does not exist under Linux. Still investigating.

mman avatar Nov 16 '22 16:11 mman