From f541d2c200faee900e2c31faf1883588c414100e Mon Sep 17 00:00:00 2001 From: euri10 Date: Wed, 15 May 2019 12:43:31 +0200 Subject: [PATCH] :sparkles: Use a logger instead of the root logging (#222) --- fastapi/openapi/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastapi/openapi/models.py b/fastapi/openapi/models.py index a045bdf70..82134d856 100644 --- a/fastapi/openapi/models.py +++ b/fastapi/openapi/models.py @@ -5,13 +5,15 @@ from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel, Schema as PSchema from pydantic.types import UrlStr +logger = logging.getLogger("fastapi") + try: import email_validator assert email_validator # make autoflake ignore the unused import from pydantic.types import EmailStr # type: ignore except ImportError: # pragma: no cover - logging.warning( + logger.warning( "email-validator not installed, email fields will be treated as str.\n" + "To install, run: pip install email-validator" )