krzysztofzablocki / LinkedConsole

Clickable links in your Xcode console, so you never wonder which class logged the message.
http://merowing.info
MIT License
931 stars 63 forks source link

Perform log parsing on a background thread. #20

Closed ewanmellor closed 8 years ago

ewanmellor commented 8 years ago

This avoids blocking Xcode for too long if a large change comes into the Xcode console. The parsing is done synchronously on the main thread (as before) if the log change is smaller than 2000 characters, otherwise it is put onto a dispatch queue for processing. Any links found that way are then batched and queued for update on the main thread.

The call to set the attributes is also changed so that it is wrapped in beginEditing / endEditing to reduce the number of change notifications that go out, and instead of three calls to addAttribute it's one call to addAttributes.

This cset also includes a small debugging function, DLog, which is disabled by default.