parent
e5df07ad0c
commit
29a0bdae77
@ -0,0 +1,25 @@ |
|||||||
|
import logging |
||||||
|
import os |
||||||
|
|
||||||
|
from dotenv import load_dotenv |
||||||
|
|
||||||
|
load_dotenv() |
||||||
|
|
||||||
|
LEVELS = { |
||||||
|
"debug": logging.DEBUG, |
||||||
|
"info": logging.INFO, |
||||||
|
"warn": logging.WARNING, |
||||||
|
"warning": logging.WARNING, |
||||||
|
"error": logging.ERROR, |
||||||
|
"critical": logging.CRITICAL, |
||||||
|
} |
||||||
|
|
||||||
|
level_name = os.getenv("DEBUG", "info").lower() |
||||||
|
level = LEVELS.get(level_name, logging.INFO) |
||||||
|
|
||||||
|
logging.basicConfig( |
||||||
|
level=level, |
||||||
|
format="%(asctime)s [%(levelname)s] %(message)s", |
||||||
|
) |
||||||
|
|
||||||
|
main_logger = logging.getLogger("picoclaw") |
||||||
Loading…
Reference in new issue