Merge pull request #7073 from adrianeboyd/feature/logger-level-in-formatter

Add time and level to default logging formatter
This commit is contained in:
Ines Montani 2021-02-24 22:40:46 +11:00 committed by GitHub
commit 592678fb7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,7 @@ CONFIG_SECTION_ORDER = ["paths", "variables", "system", "nlp", "components", "co
logger = logging.getLogger("spacy") logger = logging.getLogger("spacy")
logger_stream_handler = logging.StreamHandler() logger_stream_handler = logging.StreamHandler()
logger_stream_handler.setFormatter(logging.Formatter("%(message)s")) logger_stream_handler.setFormatter(logging.Formatter("[%(asctime)s] [%(levelname)s] %(message)s"))
logger.addHandler(logger_stream_handler) logger.addHandler(logger_stream_handler)