~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/database/debug.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-31 00:16:50 UTC
  • mfrom: (14606.3.7 apocaremains)
  • Revision ID: launchpad@pqm.canonical.com-20111231001650-pjeyhfjhm6mg3yp8
[r=wgrant][no-qa] Merge canonical.database into lp.services.database.

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