Permalink
Browse files

Added more detailed Tropo logging.

  • Loading branch information...
1 parent 1ba4184 commit fd1323ef8db77fca71a0db5834723c777f1c725a @onyxfish committed Nov 2, 2010
Showing with 11 additions and 5 deletions.
  1. +1 −1 fabfile.py
  2. +7 −1 safecity/apps/tropo/tropolib.py
  3. +3 −3 safecity/configs/production/logging.conf
View
2 fabfile.py
@@ -318,4 +318,4 @@ def _execute_psql(query):
Executes a PostgreSQL command using the command line interface.
"""
env.query = query
- run(('cd %(path)s/repository; psql -q %(project_name)s -c "%(query)s"') % env)
+ run(('cd %(path)s/repository; psql -q %(project_name)s -c "%(query)s"') % env)
View
8 safecity/apps/tropo/tropolib.py
@@ -22,6 +22,9 @@ class TropoIncomingMessage(IncomingMessage):
def __init__(self, sender, text, received):
super(TropoIncomingMessage, self).__init__(
sender, text, received, outgoing_cls=TropoOutgoingMessage)
+
+ if settings.DEBUG:
+ log.debug('Created TropoIncomingMessage: %s, %s' % (sender, text))
class TropoOutgoingMessage(OutgoingMessage):
"""
@@ -39,10 +42,13 @@ def send(self):
url = '?'.join([TROPO_URL, urlencode(params)])
+ if settings.DEBUG:
+ log.debug('Sending TropoOutgoingMessage: %s' % url)
+
urlopen(url)
# Custom HttpResponse objects
class TropoOkResponse(HttpResponse):
def __init__(self):
- super(TropoOkResponse, self).__init__(status=200)
+ super(TropoOkResponse, self).__init__(status=200)
View
6 safecity/configs/production/logging.conf
@@ -12,11 +12,11 @@ format=%(asctime)s:%(levelname)s:%(name)s:%(message)s
datefmt=%b.%d'%y %H:%M
[logger_root]
-level=WARN
+level=DEBUG
handlers=fileHandler
[logger_safecity]
-level=INFO
+level=DEBUG
handlers=fileHandler
qualname=safecity
propagate=0
@@ -25,4 +25,4 @@ propagate=0
class=FileHandler
level=INFO
formatter=simpleFormatter
-args=('/home/newsapps/logs/safecity/python.log', 'a')
+args=('/home/newsapps/logs/safecity/python.log', 'a')

0 comments on commit fd1323e

Please sign in to comment.