QGISnetworklogger plugin or what are QGIS and my service talking about…

Just released a ‘new’ plugin:
QGIS Network Logger, install via the plugin manager of QGIS version 3.6 or higher (https://plugins.qgis.org/plugins/qgisnetworklogger/).

One of the things QGIS is pretty good in is talking to OGC services (WebMapService/WMS, WebFeatureService/WFS etc etc), QGIS even talks to Esri web services.
Something what was hard in this, is that if you are an average Windows user of QGIS, with a build without debug information, you were never able to see WHAT exactly QGIS was talking about with the server…
So when QGIS fails to show something on your map, it was not always clear if it was a data problem, a QGIS problem or ( very often :-) ) a service issue.

With this plugin, made possible by work of several core-devs in QGIS 3.6 or more, you can ‘justs’ see all the GET/POST/PUT/DELETE requests that QGIS is firing off to the servers. If you are a WebDeveloper: it even listens to F12 (for others: that is the key to show the web-console in most browsers, which also show you internal information of traffic and web pages).

There is a lot to see:

Information and context menu

You see all url’s being fired, the HTTP Operation, status, query, headers from Request and Reply and data/content from the Request etc etc.

You can even ‘replay’ or try out a request in your browser or terminal, by using the context menu on a url:

open

In this example you can see that you can copy a request as a CURL (https://curl.haxx.se/) command to fetch the data or image again.
OR if it is a GET url, you can just open it in your default browser.

The work was able because in QGIS 3.6 Nyall et al. changed some code, so it was easier to ‘listen’ to all the requests that QgsNetworkManager is doing. So this plugin just listens to the requests and show them in the window.

So as long as the provider (or plugin) is using the QgsNetworkManager interface to connect to online services, you will see the requests flying by in the logger window. I hope this is an argument for plugin builders to not use Requests anymore ;-), but stick to our own network machinery.

As said: this would not have been possible without help of Nyall and Alessandro. Nyall also helped with the treeview in my first rudimentary version.
That treeview also costs me some hair though. Because of the asynchrounous nature of the web, AND the fact that you can filter the requests, I bumped in all kind of threading issues…. The tree(view) is being filled, sorted, changed, updated etc etc so fast, that I suffered a lot of crashes… BUT I think I managed to make it stable now.

If not: let me know: https://github.com/rduivenvoorde/qgisnetworklogger/issues
Also if you want to pick up one of the Feature Requests we already have :-)

Happy QGISsing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>