Introducing AlamofireSafariLogger — a lightweight Alamofire network call monitoring library
During the development cycle, I spend much time on network debugging. In android, we have Stetho. I can view all request and response on Chrome web inspector without Android Studio. In iOS development, i use console log or Charles which requires some setup (or license) on a specific macOS. I had found Stetho equivalent on iOS development but it don’t have a simple solution.
I wrote AlamofireSafariLogger because i want to make network call debugging more easily. The final result is that i log all request and response from Alamofire to Safari web inspector. Unlike Stetho, i am not logging it in “Network” tab but “Console” tab.
The final result is shown below.

Setup
pod 'AlamofireSafariLogger'
In your appDelegate,
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//add this startLogging() lineAlamofireSafariLogger.shared.startLogging()
//...}
That’s it. Now, you need to enable develop menu in Safari.
In Safari Perference > Advanced > Tick “Show Develop menu in menu bar”
If you are using device to debug, open “Setting’’ > Safari >Advanced > enable “Web Inspector”.

When you application is running, you will find a ‘about:blank’ under developer tab. Click it and you can now debug your alamofire network call with your web inspector!
Console Log Level in current design:
Header : log
Body : Warn
Error : Error