Skip to content

Commit 49b0e3f

Browse files
committed
Cleaned up logging configuration logic
1 parent 7ba7cd2 commit 49b0e3f

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

packet/__init__.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
import os
6-
from logging.config import dictConfig
76
import logging
87

98
import csh_ldap
@@ -14,24 +13,6 @@
1413

1514
from ._version import __version__
1615

17-
# Logger configuration
18-
dictConfig({
19-
"version": 1,
20-
"formatters": {"default": {
21-
"format": "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
22-
}},
23-
"handlers": {"packet": {
24-
"class": "logging.StreamHandler",
25-
"stream": "ext://sys.stdout",
26-
"level": "DEBUG",
27-
"formatter": "default"
28-
}},
29-
"root": {
30-
"level": "DEBUG",
31-
"handlers": ["packet"]
32-
}
33-
})
34-
3516
app = Flask(__name__)
3617

3718
# Load default configuration and any environment variable overrides
@@ -42,6 +23,8 @@
4223
app.config.from_pyfile(os.path.join(os.getcwd(), "config.py"))
4324

4425
app.config["VERSION"] = __version__
26+
27+
# Logger configuration
4528
logging.getLogger().setLevel(app.config["LOG_LEVEL"])
4629

4730
# Initialize the extensions

0 commit comments

Comments
 (0)