From 065b2ac7eee9dfa0397d677be2d970cc2d4d0de9 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Tue, 4 Oct 2022 05:55:50 -0700 Subject: [PATCH] If debug>2, log the URL when posting. This will work for any RESTful uploader that uses method `post_request`. --- bin/weewx/restx.py | 2 ++ weewx.conf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/weewx/restx.py b/bin/weewx/restx.py index 6fd8215a..49013205 100644 --- a/bin/weewx/restx.py +++ b/bin/weewx/restx.py @@ -533,6 +533,8 @@ class RESTThread(threading.Thread): """ # Data might be a unicode string. Encode it first. data_bytes = six.ensure_binary(data) if data is not None else None + if weewx.debug >= 2: + log.debug("%s url: '%s'", self.protocol_name, request.get_full_url()) _response = urllib.request.urlopen(request, data=data_bytes, timeout=self.timeout) return _response diff --git a/weewx.conf b/weewx.conf index d4c628f7..0786de0a 100644 --- a/weewx.conf +++ b/weewx.conf @@ -67,7 +67,7 @@ version = 4.9.0b1 [[StationRegistry]] # To register this weather station with weewx, set this to true, - # then fill out option 'station_url' above. + # then fill out option 'station_url', located in the [Station] section above. register_this_station = false [[AWEKAS]]