-
Notifications
You must be signed in to change notification settings - Fork 4
How to inspect logs and app behavior on SimplyE Open eBooks for iOS
Both SimplyE (since v3.6.2) and Open eBooks (since v1.9.0) support iOS's "Unified Logging System". This allows users of an app to access the app's logs and take a closer look at what's going on under the hood, especially if you experienced an error. You don't need to be a developer to access this.
- Connect your iOS device to your Mac (I'm not aware of this working on other platforms, but I suppose it could be possible -- maybe).
- Open /Applications/Utilities/Console.app
- Select your device on the left sidebar. Valid "devices" include simulators, beside physical iPhones, iPads, Apple TVs, Apple Watches, and Macs.
The image above shows a session where we are inspecting logs on an iPad Pro device. The main log window shows a number of columns: Date & Time, Type, Category etc. These columns are fully customizable. You can add and remove the ones you want by right-clicking in any empty space on the toolbar.
By default you will see ALL the logs being filed by ALL apps and system services on that device, so at first this can be a lot. If you see an entry you don't care for, simply right click on it and select one of the "Hide XYZ" options. This will add a "red" filter entry in the search bar at the top. As you can see in the pic, I have filtered out a bunch of system libraries (CFNetwork, libnetwork.dylib) and the "BoringSSL" category since those were too low-level and verbose for my needs.
Conversely, you can focus on a particular Process/Library/Type/etc that you are interested in: for e.g. I chose the SimplyE process, so all logging done by other processes is hidden.
SimplyE files accurate log "Type" aka "log level". We have 5 different types:
- Faults: these are related to a system-level issues and are indicated with a red dot on the Type column.
- Error: these indicate an actual error encountered by the application. They are displayed in yellow.
- Default: more like a warning or non-blocking error. The Type column is just left blank for these.
- Info: Indicated with a light grey dot, they indicate notable non-error events during the app execution.
- Debug: Shown as dark grey dots, these are used sparingly and they could display more verbose information used for debugging purposes only.
So for example you can choose to show only "Errors" if you want. As a matter of fact, by default Info and Debug entries are hidden by default, but you can display them from the Action menu.
Selecting a log entry and pressing left/right arrow will expand the log display. You can also use the detail section at the bottom to display that automatically.
More can be done with the Unified Logging System. For example, we could define subsystems within SimplyE and log events related to that specifically. That will allow us to filter by "Category", which as you can see is currently empty.
We could also correlate activities in order to track events in a hierarchical way: e.g. from when a user taps a button, to the UI level logic, down to the execution of a network API call and its asynchronous result. This is possible but more work is needed in our client-side infrastructure.