Skip to content

Commit abdb6df

Browse files
committed
added comments
1 parent 74e6dd0 commit abdb6df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cs50/sql.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
def _enable_logging(f):
2+
"""Enable logging of SQL statements when Flask is in use."""
3+
24
import logging
35
import functools
46

57
@functools.wraps(f)
68
def decorator(*args, **kwargs):
9+
10+
# Infer whether Flask is installed
711
try:
812
import flask
913
except ModuleNotFoundError:
1014
return f(*args, **kwargs)
1115

16+
# Enable logging
1217
disabled = logging.getLogger("cs50").disabled
1318
if flask.current_app:
1419
logging.getLogger("cs50").disabled = False

0 commit comments

Comments
 (0)