Skip to content

Commit aef40a5

Browse files
committed
Fixed log level
1 parent fd787f2 commit aef40a5

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

app.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99

1010
from github import Auth, GithubIntegration, UnknownObjectException
1111

12-
# LOG CONFIGURATION
12+
# CONFIGURE THE ENVIRONMENT
1313

14+
# Load all env variables
15+
load_dotenv()
16+
17+
# Configure logging
18+
log_level = os.getenv('LOG_LEVEL', 'INFO')
1419
dictConfig({
1520
'version': 1,
1621
'formatters': {'default': {
@@ -22,32 +27,12 @@
2227
'formatter': 'default'
2328
}},
2429
'root': {
25-
'level': 'INFO',
30+
'level': log_level,
2631
'handlers': ['wsgi']
2732
}
2833
})
2934

30-
"""logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s")
31-
logLevel = logging.INFO
32-
rootLogger = logging.getLogger()
33-
34-
if not os.path.exists('logs'):
35-
os.makedirs('logs')
36-
fileHandler = logging.handlers.RotatingFileHandler("logs/output.log")
37-
fileHandler.setFormatter(logFormatter)
38-
fileHandler.setLevel(logLevel)
39-
rootLogger.addHandler(fileHandler)
40-
41-
consoleHandler = logging.StreamHandler()
42-
consoleHandler.setFormatter(logFormatter)
43-
consoleHandler.setLevel(logLevel)
44-
rootLogger.addHandler(consoleHandler)"""
45-
46-
# LOADING ENVIRONMENT VARIABLES
47-
48-
load_dotenv()
49-
50-
# Configurations
35+
# Load application configs
5136
github_app_id = os.getenv("GH_APP_ID")
5237
github_app_private_key = os.getenv("GH_APP_PRIVATE_KEY")
5338
endpoint_secret = os.getenv("INCOMING_SECRET")

0 commit comments

Comments
 (0)