beans-logging 3.0.1__tar.gz → 3.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {beans_logging-3.0.1 → beans_logging-3.0.3}/PKG-INFO +2 -2
  2. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/__version__.py +1 -1
  3. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/_base.py +3 -3
  4. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/fastapi/_middleware.py +5 -2
  5. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging.egg-info/PKG-INFO +2 -2
  6. {beans_logging-3.0.1 → beans_logging-3.0.3}/LICENSE.txt +0 -0
  7. {beans_logging-3.0.1 → beans_logging-3.0.3}/README.md +0 -0
  8. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/__init__.py +0 -0
  9. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/_handler.py +0 -0
  10. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/_utils.py +0 -0
  11. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/auto.py +0 -0
  12. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/fastapi/__init__.py +0 -0
  13. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/fastapi/_filter.py +0 -0
  14. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/fastapi/_format.py +0 -0
  15. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/fastapi/_handler.py +0 -0
  16. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/filter.py +0 -0
  17. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/format.py +0 -0
  18. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/rotation.py +0 -0
  19. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/schema.py +0 -0
  20. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging/sink.py +0 -0
  21. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging.egg-info/SOURCES.txt +0 -0
  22. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging.egg-info/dependency_links.txt +0 -0
  23. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging.egg-info/requires.txt +0 -0
  24. {beans_logging-3.0.1 → beans_logging-3.0.3}/beans_logging.egg-info/top_level.txt +0 -0
  25. {beans_logging-3.0.1 → beans_logging-3.0.3}/setup.cfg +0 -0
  26. {beans_logging-3.0.1 → beans_logging-3.0.3}/setup.py +0 -0
  27. {beans_logging-3.0.1 → beans_logging-3.0.3}/tests/__init__.py +0 -0
  28. {beans_logging-3.0.1 → beans_logging-3.0.3}/tests/conftest.py +0 -0
  29. {beans_logging-3.0.1 → beans_logging-3.0.3}/tests/test_beans_logging.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: beans_logging
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: beans_logging is a python package for simple logger and easily managing logging modules. It is a Loguru based custom logging package for python projects.
5
5
  Home-page: https://github.com/bybatkhuu/module.python-logging
6
- Download-URL: https://github.com/bybatkhuu/module.python-logging/archive/v3.0.1.tar.gz
6
+ Download-URL: https://github.com/bybatkhuu/module.python-logging/archive/v3.0.3.tar.gz
7
7
  Author: Batkhuu Byambajav
8
8
  Author-email: batkhuu10@gmail.com
9
9
  License: MIT
@@ -1,3 +1,3 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- __version__ = "3.0.1"
3
+ __version__ = "3.0.3"
@@ -63,7 +63,7 @@ class LoggerLoader:
63
63
  self,
64
64
  config: Union[LoggerConfigPM, dict, None] = None,
65
65
  config_file_path: str = _CONFIG_FILE_PATH,
66
- load_config_file: bool = True,
66
+ auto_config_file: bool = True,
67
67
  auto_load: bool = False,
68
68
  ):
69
69
  """LoggerLoader constructor method.
@@ -73,7 +73,7 @@ class LoggerLoader:
73
73
  dict,
74
74
  None ], optional): New logger config to update loaded config. Defaults to None.
75
75
  config_file_path (str , optional): Logger config file path. Defaults to `LoggerLoader._CONFIG_FILE_PATH`.
76
- load_config_file (bool , optional): Indicates whether to load logger config file or not. Defaults to True.
76
+ auto_config_file (bool , optional): Indicates whether to load logger config file or not. Defaults to True.
77
77
  auto_load (bool , optional): Indicates whether to load logger handlers or not. Defaults to False.
78
78
  """
79
79
 
@@ -83,7 +83,7 @@ class LoggerLoader:
83
83
 
84
84
  self._load_env_vars()
85
85
 
86
- if load_config_file:
86
+ if auto_config_file:
87
87
  self._load_config_file()
88
88
 
89
89
  if config:
@@ -5,6 +5,7 @@ import time
5
5
  from uuid import uuid4
6
6
 
7
7
  from fastapi import Request, Response
8
+ from fastapi.concurrency import run_in_threadpool
8
9
  from starlette.middleware.base import BaseHTTPMiddleware
9
10
 
10
11
  from beans_logging import logger
@@ -155,7 +156,8 @@ class HttpAccessLogMiddleware(BaseHTTPMiddleware):
155
156
  _http_info["user_id"] = str(request.state.user_id)
156
157
 
157
158
  _debug_msg = self.debug_format.format(**_http_info)
158
- _logger.debug(_debug_msg)
159
+ # _logger.debug(_debug_msg)
160
+ await run_in_threadpool(_logger.debug, _debug_msg)
159
161
 
160
162
  _start_time = time.time()
161
163
  response = await call_next(request)
@@ -218,6 +220,7 @@ class HttpAccessLogMiddleware(BaseHTTPMiddleware):
218
220
  )
219
221
 
220
222
  _msg = _msg_format.format(**_http_info)
221
- _logger.bind(http_info=_http_info).log(_LEVEL, _msg)
223
+ # _logger.bind(http_info=_http_info).log(_LEVEL, _msg)
224
+ await run_in_threadpool(_logger.bind(http_info=_http_info).log, _LEVEL, _msg)
222
225
 
223
226
  return response
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: beans-logging
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: beans_logging is a python package for simple logger and easily managing logging modules. It is a Loguru based custom logging package for python projects.
5
5
  Home-page: https://github.com/bybatkhuu/module.python-logging
6
- Download-URL: https://github.com/bybatkhuu/module.python-logging/archive/v3.0.1.tar.gz
6
+ Download-URL: https://github.com/bybatkhuu/module.python-logging/archive/v3.0.3.tar.gz
7
7
  Author: Batkhuu Byambajav
8
8
  Author-email: batkhuu10@gmail.com
9
9
  License: MIT
File without changes
File without changes
File without changes
File without changes