This Week's Sponsor:

Kolide

Ensure that if a device isn’t secure it can’t access your apps.  It’s Device Trust for Okta.


Logger Is the Missing Console for Shortcuts Power Users

Logger for Shortcuts.

Logger for Shortcuts.

Indie developer Alex Hay has long pushed the boundaries of what third-party developers can build with the SiriKit framework and Shortcuts integrations on Apple platforms.

In late 2019, his Toolbox Pro app redefined what it means to complement Apple’s Shortcuts app with additional actions, creating an entirely new sub-genre of headless utilities designed to provide additional actions with configurable parameters. Recently, Hay introduced Nautomate, another utility that provides users with Shortcuts actions to integrate with the Notion API without having to write a single line of code. And today, Hay is launching Logger, another Shortcuts-compatible app that is similar to his previous ones, but with a twist: rather than adding actions for external services or apps such as Apple Music and Notion, Logger offers actions to create the troubleshooting console that has always been missing from Shortcuts.

In the Shortcuts chapter of my iOS and iPadOS reviews over the past few years, I’ve always pointed out how I would have liked to see Apple devote more attention to power-user features for advanced Shortcuts users. While I can’t complain about the additions in 2021 (such as the ability to fold blocks of actions and the multiple scripting-related additions in Shortcuts for macOS), the truth is that there’s still a lot of low-hanging fruit in Shortcuts when it comes to quality-of-life improvements for advanced users. Among the features I (and others) have pointed out, I believe the most important one that should be at the top of Apple’s list is a proper console to log error messages and other information so that users can easily debug what’s going on in a shortcut.

If you’re familiar with any programming language – even AppleScript – you know how essential a console is, and I don’t think I need to explain what consoles are and why they’re useful to programmers in this story. But a few clarifications are needed in the context of Shortcuts, which I also consider its own programming language, albeit a visual one.

First, Shortcuts’ Content Graph engine can produce variables of several different types and, because of implicit type coercion between actions, it’s useful to know when, say, a JPEG image gets passed around as its filename rather than the actual image file. Additionally, Shortcuts power users have long been running their own DIY “console” to log errors and other details in shortcuts, namely by using the Show Alert action and putting the variables they wanted to double check inside it. This approach is terrible for a variety of reasons: alerts are modal, so they pause the execution of a shortcut and you have to manually dismiss them; plus, they’re a pain to set up and can only provide a plain text representation of what you’re passing to them. For these reasons, we’ve been getting by with actions such as Show Alert, Get Type, and Quick Look as primitive debugging tools, but a better, native solution is needed.

That’s where the new Logger app by Alex Hay comes in. Until Apple builds a real console for power users in Shortcuts (Automator had one), Logger is going to be my go-to approach to debug shortcuts I’m working on and understand what’s happening under the hood. Logger is comprised of two parts: its actions for the Shortcuts app to log data, and the main app UI, where you can see and inspect the items you’ve logged to the console. The actions provided by Logger are:

  • Start Logging
  • Log Message
  • Clear Messages
  • Delete Tags
  • Log Conditional Message
  • Log Device Details
  • Log Files
  • Log Images
  • Log Internet Connection
  • Output Messages

You can drop these actions into a shortcut and configure them to fine-tune the data you want to log to the app’s console. Thanks to the Shortcuts framework, these actions log data in the background, meaning that they will save items in the Logger app without launching it. It took me two minutes to go from having no logging whatsoever in a new shortcut I’ve been working on to a system that logs if the shortcut is running on a Mac, if it receives images or files from the share sheet, and whether or not it can find any input to the shortcut.

An example of how you can configure Logger's actions and check results in the app in real-time.

An example of how you can configure Logger’s actions and check results in the app in real-time.

I particularly appreciate the Log Conditional Message action, which has its own if-else logic built-in to log messages to the console based on the state of a variable.

With this technique, you can log a message to Logger's console only if a variable exists.

With this technique, you can log a message to Logger’s console only if a variable exists.

Then there’s the Logger app, which displays messages you’ve logged via its Shortcuts actions. Logger updates in the background in real-time as a shortcut runs, and it even syncs across devices (Mac included) via iCloud, so you can check out your logged messages on any platform. As seen in other modern consoles for programmers, there are useful options and filters in here: you can search your logged messages; you can tag messages beforehand and later filter by tag in the console; there are built-in filters to narrow down the list of logged items by platform, time range, file type, and whether they were info/success/warning/error messages.

The main Logger app.

The main Logger app.

Filters for messages saved in Logger.

Filters for messages saved in Logger.

That’s all there is to Logger, but it’s exactly the console view I’ve long wanted Apple to build right into Shortcuts itself. In the couple of days I’ve been testing Logger on all my devices, it has helped me debug how shortcuts receive input from the share sheet on iOS/iPadOS or Finder’s quick actions on macOS; I’ve used it to confirm that Music actions were correctly finding songs in my library; I’ve even leveraged its iCloud sync to log data in Shortcuts for Mac and view results thanks to Universal Contol in Logger on the iPad Pro that was sitting next to my MacBook Pro.

Logger combines the visual, variable-based approach of Shortcuts with the power-user nature and flexibility of traditional developer consoles. It’s an extremely niche utility that only a subset of Shortcuts users and MacStories readers will use. Logger is the kind of app that “if you know, you know” you’re going to need in your daily Shortcuts workflow. Logger is a Universal, one-time $9.99 purchase, and it’s available on the App Store today.

Unlock More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.