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")
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?