remirobert / Dotzu

:iphone::eyes: In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.
MIT License
1.8k stars 142 forks source link

Network logging doesn't seem to work #5

Closed edasque closed 7 years ago

edasque commented 7 years ago

Even though it's enabled in the settings, after doing a few network requests (based on Alamofire), nothing seems to register in the network tab.

Erik

remirobert commented 7 years ago

Ok, did you had the logger to your Alamofire manager ?

let configuration = URLSessionConfiguration.default

//This line add the logger to your configuration
Dotzu.sharedManager.addLogger(session: configuration)

sessionManager = Alamofire.SessionManager(configuration: configuration)

sessionManager.request(url).responseJSON { response in
        Logger.info("response for url : [\(url)] : \(response)")
}
remirobert commented 7 years ago

@edasque did it work for you ? Please reopen the request if not.

Thanks. 🙏

edasque commented 7 years ago

I must be missing out something obvious because by adding this code, none of my queries succeed, most of them with a canceled (500?) some just silently in gray with a request latency of 0ms. I don't really know what to do from here. I changed:

    let configuration = URLSessionConfiguration.default

    Alamofire.request(API_URL, method:.get, parameters: search_parameters).responseJSON { response in

to

    let configuration = URLSessionConfiguration.default

    // This line add the logger to your configuration
    Dotzu.sharedManager.addLogger(session: configuration)

    let alamofireSessionManager = Alamofire.SessionManager(configuration: configuration)
    let start = Date()
    alamofireSessionManager.request(API_URL, method:.get, parameters: search_parameters).responseJSON { response in
edasque commented 7 years ago

@remirobert , FYI I can't re-open