Skip to content

Commit 86704e4

Browse files
committed
normalizing whitespace in log, removing .logger
1 parent a82d84e commit 86704e4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
package_dir={"": "src"},
1717
packages=["cs50"],
1818
url="https://github.com/cs50/python-cs50",
19-
version="2.3.1"
19+
version="2.3.2"
2020
)

src/cs50/sql.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(self, url, **kwargs):
2424

2525
# log statements to standard error
2626
logging.basicConfig(level=logging.DEBUG)
27-
self.logger = logging.getLogger("cs50")
2827

2928
# create engine, raising exception if back end's module not installed
3029
self.engine = sqlalchemy.create_engine(url, **kwargs)
@@ -123,7 +122,7 @@ def process(value):
123122
result = self.engine.execute(statement)
124123

125124
# log statement
126-
self.logger.debug(statement)
125+
logging.getLogger("cs50").debug(re.sub(r"\n\s*", " ", sqlparse.format(statement, reindent=True)))
127126

128127
# if SELECT (or INSERT with RETURNING), return result set as list of dict objects
129128
if re.search(r"^\s*SELECT", statement, re.I):

0 commit comments

Comments
 (0)