NSLogger is a well known logging framework that is sometimes compared with NSLog because of their matching features. However NSLogger has advantage over NSLog in terms of log details, as it adds some extra information to the logs. Another advantage NSLogger is its amazingly built desktop application to view the logs. Detailed information about NSLogger API is given here.
Developing multi threaded apps is hard and most of the times the complex data models make it harder to understand the exact execution path and execution timing of an app. Generally it is considered that collecting as much information as you can about the internal working of the app is essential to understand app’s behavior. This seems like an effective solution at the first glance but it is counterproductive as finding the exact root cause of a particular bug from the pile of information is difficult.
That’s where NSLogger excels; this tool is specifically developed to help developers and testers understand the code’s behavior while giving them full access to the logs. Let’s see what features NSLogger does provide and how they can help in iOS app development.
Advanced Logging Options
NSLogger can log text messages as well as binary data and images without any limit or restriction. Binary data can help in many situations where it this feature could be called with a simple API action. Image logging comes in handy in case you want to test the visual aspects of your app or want to inspect the issue by taking a screenshot.
Information categorization is one of the best features of NSLogger. As mentioned above, it gets harder and harder to find the real culprit behind a bug with the complexity of the app and the volume of log data. For easier searching, NSLogger categorizes log data based on different tags and levels. Tags are used to define the category of log data like graphics, networking etc. while the levels are used to define whether the log data is generic or highly specific.
NSLogger can help developers and testers understand their log data by allowing them to see it in different views. Developers can use multiple filters to see the exact relevant information they want to see. For example, some filters give detailed information about the time lapse between different logs.
Developers can save different log sessions separately for later analysis. Also, log sessions could be sent to other developers and testers. This feature comes in handy when different team members work on the same project.
NSLogger uses a secure connection by encrypting the communication with SSL. This advanced security features helps developers and testers collaborate their work with their coworkers without worrying about the privacy of the project.
Getting Started With NSLogger
The first step is to close the NSLogger repository on GIT and you can do that by using the following command.
$ git clone git://github.com/fpillet/NSLogger.git
The next step is to sign your code. Although this is not necessary but highly recommended to allow application to establish SSL connection without any trouble; without signing the app, you might face some issues with the connection if the firewall on macOS is turned on which is likely the case. After starting the app for the first time, you’d get a confirmation dialog by firewall to accept the connection or not. However, because of the complex issue involved with Keychain and firewall signing the app, the SSL connection would fail and you would be asked to restart the app.
To avoid this issue, you need a certificate; iOS developers registered with Apple already have their certificate and if you can refer to the Apple’s official website for detailed instructions. Install that certificate in the Keychain and open NSLogger project in Xcode.
From there navigate to “All Configuration” >> “Code Signing Section” and select your identity. For detailed instructions and more explanation, you can see the information provided here.
NSLogger Feature Summary
NSLogger is an alternative of the traditional logging methods like NSLog in iOS development and it has several advantages like image logging, filtering, timing information and others.
- Developers can view logs directly from NSLogger desktop viewer, send logs to local network for team collaboration or send logs to remote clients using services like Bugfender.
- It provides secure connection for logging and uses SSL for encryption.
- NSLogger can export logs to text files.
- Log data could be categorized based on its characteristics.
- Log data could be filtered using advance options.
- Logs could be saved or shared with other collaborators.
NSLogger is fully compatible with Bugfender and both platforms can provide excellent logging features to developers and testers. Although NSLogger is an amazing logging framework, it only works with local devices and cannot work remotely. However, in most of the cases it is not possible to have the intended device with you to check the logs and reproducing the exact bug in controlled environment is not an option. With the help of Bugfender, developers and testers can remotely access all the logs on devices located thousands of miles away.
Besides remote logging features, Bugfender provides full control over the logging process to the developers so they can manage the devices they want to log without gathering unnecessary log data from devices where the app works perfectly. For example, if the app is not working on a particular model then developers can opt to gather log data from those devices and disable logging feature on other devices.
Another great benefit of using Bugfender is its ability to overcome the issue of device fragmentation. This refers to thousands of different devices running different variants of the operating system that makes it impossible for developers to optimize and test their apps on all of those devices. That’s why developers mainly focus on most popular devices and lose the entire audience running other devices. Bugfender resolves this issue and prevent negative feedback from users by allowing developers to discover the bugs before users do.