Skip to content

Commit f6ee731

Browse files
authored
Fix/correct log level (#11)
1 parent 53d295c commit f6ee731

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

py_spring_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from py_spring_core.event.commons import ApplicationEvent
1717
from py_spring_core.event.application_event_handler_registry import EventListener
1818

19-
__version__ = "0.0.16"
19+
__version__ = "0.0.17"
2020

2121
__all__ = [
2222
"PySpringApplication",

py_spring_core/core/application/py_spring_application.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ def __init_controllers(self) -> None:
216216

217217
def __configure_uvicorn_logging(self):
218218
"""Configure Uvicorn to use Loguru instead of default logging."""
219-
220-
219+
# Configure Uvicorn to use Loguru
221220
# Intercept standard logging and redirect to loguru
222221
class InterceptHandler(logging.Handler):
223222
def emit(self, record):
@@ -236,10 +235,11 @@ def emit(self, record):
236235
logger.opt(depth=depth, exception=record.exc_info).log(level, record.getMessage())
237236

238237
# Remove default uvicorn logger and add intercept handler
239-
logging.basicConfig(handlers=[InterceptHandler()], level=0, force=True)
238+
log_level = self.app_config.loguru_config.log_level.value
239+
logging.basicConfig(handlers=[InterceptHandler()], level=log_level, force=True)
240240

241241
def __run_server(self) -> None:
242-
# Configure Uvicorn to use Loguru
242+
243243

244244

245245
# Run uvicorn server

0 commit comments

Comments
 (0)