LogUI build 58 reads and writes JSON, and more
Until now, LogUI has largely been an interactive log browser, and only able to export log excerpts in Rich Text format. This new build adds three tools to greatly increase its usefulness, as it can now write log excerpts in JSON format, open saved files, and filter out unwanted log entries. To give a simple example, this screenshot shows a log extract that has been reduced to entries made only by LaunchServices, converted from JSON to CSV, and imported into Numbers.
There are three new tools in LogUI’s toolbar.
From the left:
- Get Log fetches and displays log entries specified by the current log settings, as before.
- Read JSON opens a dialog for you select a LogUI JSON file, and loads its log entries into the window, replacing its current contents.
- Gloss opens the Gloss window with message text from selected log entries, enabling you to use Writing Tools and other aids, as before.
- Reduce applies the current search to current log entries. This removes all entries that are excluded by that search, so reducing the number of log entries. If you want to keep a copy of the unreduced log, save it as a JSON file before reduction.
- Save JSON opens a dialog for you to save the current log records to a new LogUI JSON file. This has the type
co.eclecticlight.loguilog
, and the extension.logui
, and can be used as a regular JSON export with other apps capable of importing JSON format. - Save RTF saves the current log excerpt as a Rich Text Format file, using the same colour conventions, as before.
You can now filter log entries in several ways, one at a time or all together:
- You can apply a predicate to determine which log entries are fetched in the first place, perhaps limiting them to one or two subsystems.
- You can search for subsystems, sender or process names, or contents of messages in the search box.
- When you have filtered the displayed log entries to those that you want, you can reduce the excerpt to include just those, and save that excerpt.
- You can then open the saved, reduced excerpt and use further searches to navigate and analyse those entries.
As we’ve recently been discussing different types of Spotlight search, I should perhaps explain that LogUI’s search isn’t word-based, simply finds matching sequences of characters, and doesn’t support regex or wild card search. If you search for the characters arb, then it will find them in the words nearby and arbitrary, but not in arabesque.
There are two current limitations with these new JSON documents. If you double-click one, LogUI should launch automatically and will then open a new window, but won’t load that document into the window, as that part of its internal wiring isn’t yet complete. The same also happens if you try dropping a document onto the app. I did hope to have drag and drop working in this release, but the resulting code proved too complex for the Swift compiler in Xcode to negotiate, so that will also wait for a future build.
LogUI 1.0 build 58 is now available from here: logui158
and from its Product Page.
This is likely to be the last update for a couple of weeks, as I expect I’ll be immersed in WWDC and its fallout for much of the next fortnight. My outstanding tasks are:
- complete the predicate editor in Settings;
- add support for opening documents from the Finder;
- add drag and drop support.
I’m also thinking about additional search/filter support, and whether a more compact binary document format might be a worthwhile alternative for large log excerpts.
As ever, I value your comments and suggestions.