Feat: Set debug if env var is true.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
"""Creates logger for Dakiny bot."""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
dakiny_logger = logging.getLogger("default")
|
||||
dakiny_logger.setLevel(logging.INFO)
|
||||
dakiny_logger.setLevel(logging.DEBUG if os.getenv("DEBUG") == "true" else logging.INFO)
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
|
||||
dakiny_logger.addHandler(handler)
|
||||
|
||||
Reference in New Issue
Block a user