playing with logging
This commit is contained in:
1 parent
e89fb9fae1
commit
a7c0a58c9a
6 files changed
+80
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
def configure_logger(level: str = "INFO", test: str = None) -> None:
|
||||
"""Configure the logger.
|
||||
Args:
|
||||
level (str, optional): The logging level. Defaults to "INFO".
|
||||
"""
|
||||
logging.basicConfig(
|
||||
level=level,
|
||||
datefmt="%Y-%m-%dT%H:%M:%S%z",
|
||||
format="%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s"
|
||||
f" {test}",
|
||||
handlers=[logging.StreamHandler(sys.stdout)],
|
||||
)
|
||||
Reference in new issue
Block a user