[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Add some more debug level messages



commit ea311bbc6fd19700e6179e128a8e9abfd5fc84e2
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Thu Sep 22 16:07:52 2016 +0200

    Add some more debug level messages
---
 ooni/agent/scheduler.py | 3 +++
 ooni/deck/store.py      | 4 +++-
 ooni/geoip.py           | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ooni/agent/scheduler.py b/ooni/agent/scheduler.py
index cc71ee4..f6b52b7 100644
--- a/ooni/agent/scheduler.py
+++ b/ooni/agent/scheduler.py
@@ -123,6 +123,7 @@ class ScheduledTask(object):
             raise DidNotRun
         try:
             if self.last_run == CANARY_DATE:
+                log.debug("Detected first run")
                 yield defer.maybeDeferred(self.first_run)
             last_run_time = datetime.utcnow()
             yield self.task()
@@ -149,6 +150,8 @@ class UpdateInputsAndResources(ScheduledTask):
     def task(self):
         log.debug("Updating the inputs")
         yield probe_ip.lookup()
+        log.debug("Updating the inputs for country %s" %
+                  probe_ip.geodata['countrycode'])
         yield resources.check_for_update(probe_ip.geodata['countrycode'])
         yield input_store.update(probe_ip.geodata['countrycode'])
         yield probe_ip.resolveGeodata()
diff --git a/ooni/deck/store.py b/ooni/deck/store.py
index d88f5d5..1e4785e 100644
--- a/ooni/deck/store.py
+++ b/ooni/deck/store.py
@@ -6,7 +6,7 @@ from copy import deepcopy
 from twisted.internet import defer
 from twisted.python.filepath import FilePath
 
-from ooni.utils import mkdir_p
+from ooni.utils import mkdir_p, log
 from ooni.deck.deck import NGDeck
 from ooni.otime import timestampNowISO8601UTC
 from ooni.resources import check_for_update
@@ -41,6 +41,8 @@ class InputStore(object):
                 yield check_for_update(country_code)
 
             if not in_file.exists():
+                log.msg("Could not find input for country "
+                        "{0} in {1}".format(cc, in_file.path))
                 continue
 
             # XXX maybe move this to some utility function.
diff --git a/ooni/geoip.py b/ooni/geoip.py
index 5e6b275..9148e34 100644
--- a/ooni/geoip.py
+++ b/ooni/geoip.py
@@ -215,6 +215,7 @@ class ProbeIP(object):
             self.address = None
 
         if self.address:
+            self.resolveGeodata(include_ip, include_asn, include_country)
             defer.returnValue(self.address)
         else:
             self._state = IN_PROGRESS



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits