New App - Console Logger [Deprecated]


Note: This approach has been replaced with the usage of OSLog.


When starting a new app, I usually like to set up a console logger right from the scratch.

I like to use a simple enum with different verbosity levels:


SwiftUI view to change the verbosity

I also like to have a Picker to display inside a DeveloperMenu to change the verbosity:

It looks like this:



With this code in place, you can call the Logger directly from any place in your app:

Logger.log(.err, "Something went wrong")


Network Logger

I’ve also written a post about a NetworkLogger, for logging information about networking requests/responses/object decoding/etc.

Do you use some sort of console logger in your apps?

New App - Console Logger [Deprecated] |
Tags: iOS tools
Share: Twitter LinkedIn