summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-12-04 19:57:32 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-12-04 19:57:32 (GMT)
commit569f2b9e8947bb7307b92e64c01daed4b20e56b1 (patch)
treeba88c89589b493d93515811d97dc2948596b1ded
parent0ee4387f59c05042555c2edfed0411205f607a78 (diff)
downloadtabellio.searchform-569f2b9e8947bb7307b92e64c01daed4b20e56b1.zip
tabellio.searchform-569f2b9e8947bb7307b92e64c01daed4b20e56b1.tar.gz
tabellio.searchform-569f2b9e8947bb7307b92e64c01daed4b20e56b1.tar.bz2
add logging of searches
-rw-r--r--tabellio/searchform/form.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py
index c156efe..ea56c04 100644
--- a/tabellio/searchform/form.py
+++ b/tabellio/searchform/form.py
@@ -3,6 +3,7 @@
import re
import time
import datetime
+import logging
from five import grok
from plone.memoize import instance, ram
@@ -41,6 +42,8 @@ from tabellio.documents.typenames import MAPPING
import cmpfunctions
+log = logging.getLogger('Plone')
+
class ListAuthorsView(BrowserView):
def get_folder_at_path(self, path):
current = self.portal
@@ -702,6 +705,7 @@ class SearchView(BrowserView):
cursor = self.db_connection.cursor()
except AttributeError:
return []
+ log.info('Calling to postgresql for search (%r)' % text)
# looks like there's no way to quote things properly for to_tsquery,
from plone.i18n.normalizer.fr import normalizer
text = re.sub(r'[^\w\s]', ' ', normalizer.normalize(text))
@@ -847,6 +851,7 @@ class SearchView(BrowserView):
catalog = getToolByName(self.context, 'portal_catalog')
print 'kw:', kw
+ log.info('Performing search (%r)' % kw)
return sorted(catalog(**kw), cmp_function)
def deputy_search_form(self):