Commit 1c569416 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Disable by default MySQL queries logging.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@786 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 64befbf0
......@@ -27,6 +27,8 @@ from neo.storage.database import DatabaseManager
from neo.exception import DatabaseFailure
from neo.protocol import DISCARDED_STATE, INVALID_PTID
LOG_QUERIES = False
def p64(n):
return pack('!Q', n)
......@@ -79,14 +81,15 @@ class MySQLDatabaseManager(DatabaseManager):
"""Query data from a database."""
conn = self.conn
try:
printable_char_list = []
for c in query.split('\n', 1)[0][:70]:
if c not in string.printable or c in '\t\x0b\x0c\r':
c = '\\x%02x' % ord(c)
printable_char_list.append(c)
query_part = ''.join(printable_char_list)
logging.debug('querying %s...', query_part)
if LOG_QUERIES:
printable_char_list = []
for c in query.split('\n', 1)[0][:70]:
if c not in string.printable or c in '\t\x0b\x0c\r':
c = '\\x%02x' % ord(c)
printable_char_list.append(c)
query_part = ''.join(printable_char_list)
logging.debug('querying %s...', query_part)
conn.query(query)
r = conn.store_result()
if r is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment