toast toast - 3 days ago 4
iOS Question

Simple Swift 3 logging solution

I want to implement logging in my application. I want it to be simple and to not affect performance.

I've looked into Apple's newly released logging APIs:
https://developer.apple.com/reference/os/1891852-logging

I did implement a quick example in my app, but I couldn't see the output unless I ran in "Test" mode. Is there any way to view this output in the normal "Run" mode?

Also I need to be able to log the entries to file so that I review them later when I connect the device to my mac. Eventually I'm going to have it upload this file to my server, when a debug option is checked in my app.

Thanks.

Answer

I made this to solve the problem.

https://github.com/notoriousturtle/DebugLog

A simple Swift debug logging solution, with file upload designed for iOS, and WatchOS written in Swift 3.

Comments