~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/database/debug.py

  • Committer: Steve Kowalik
  • Date: 2011-08-07 04:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 13626.
  • Revision ID: stevenk@ubuntu.com-20110807040552-mwnxo0flmhvl35e8
Correct the notification based on review comments, and remove request{,ed}
from the function names, switching to create{,d}.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
'''
7
7
 
8
8
import logging
9
 
import textwrap
10
 
import traceback
11
 
 
12
9
import psycopg
 
10
import traceback, textwrap
13
11
 
14
12
# From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/279155
15
13
def LN(*args, **kwargs):
53
51
    _real_con = None
54
52
    def __init__(self, real_con):
55
53
        self.__dict__['_log'] = \
56
 
                logging.getLogger('lp.services.database.debug').debug
 
54
                logging.getLogger('canonical.database.debug').debug
57
55
        self.__dict__['_real_con'] = real_con
58
56
 
59
57
    def __getattr__(self, key):
72
70
def debug_connect(*args, **kw):
73
71
    global _org_connect
74
72
    con = ConnectionWrapper(_org_connect(*args, **kw))
75
 
    logging.getLogger('lp.services.database.debug').debug(
 
73
    logging.getLogger('canonical.database.debug').debug(
76
74
            'connect(*%r, **%r) == %r', args, kw, con
77
75
            )
78
76
    print '%s connect(*%r, **%r) == %r' % (LN(), args, kw, con)