summaryrefslogtreecommitdiff
path: root/alot/addressbook
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2019-02-04 20:26:44 +0900
committerPatrick Totzke <patricktotzke@gmail.com>2019-02-06 13:38:16 +0000
commit0a55181562e931abf050124b600ce835dfce8f01 (patch)
tree80ebcf855c9e7858ccdd05ff6559456c627f3c18 /alot/addressbook
parentfff58de316f31267923cad28670ce6c033e93c83 (diff)
addressbook: add logging statements
to help troubleshoot problems
Diffstat (limited to 'alot/addressbook')
-rw-r--r--alot/addressbook/external.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/alot/addressbook/external.py b/alot/addressbook/external.py
index 93e76784..eea70cbc 100644
--- a/alot/addressbook/external.py
+++ b/alot/addressbook/external.py
@@ -6,6 +6,7 @@ import re
from ..helper import call_cmd
from ..helper import split_commandstring
from . import AddressBook, AddressbookError
+import logging
class ExternalAddressbook(AddressBook):
@@ -59,9 +60,11 @@ class ExternalAddressbook(AddressBook):
raise AddressbookError(msg)
if not resultstring:
+ logging.debug("No contacts in address book (empty string)")
return []
lines = resultstring.splitlines()
res = []
+ logging.debug("Apply %s on %d results" % (self.regex, len(lines)))
for l in lines:
m = re.match(self.regex, l, self.reflags)
if m:
@@ -70,4 +73,5 @@ class ExternalAddressbook(AddressBook):
email = info['email'].strip()
name = info['name']
res.append((name, email))
+ logging.debug("New match name=%s mail=%s" % (name, email))
return res