cuneus 0.2.7__py3-none-any.whl → 0.2.8__py3-none-any.whl

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.
cuneus/core/logging.py CHANGED
@@ -5,6 +5,7 @@ Structured logging with structlog and request context.
5
5
  from __future__ import annotations
6
6
 
7
7
  import logging
8
+ import shutil
8
9
  import time
9
10
  import uuid
10
11
  from typing import Any, Awaitable, Callable
@@ -36,9 +37,14 @@ def configure_structlog(settings: Settings | None = None) -> None:
36
37
  structlog.processors.UnicodeDecoder(),
37
38
  ]
38
39
 
39
- renderer: structlog.types.Processor = structlog.dev.ConsoleRenderer(colors=True)
40
- if log_settings.log_json: # pragma: no cover
41
- renderer = structlog.processors.JSONRenderer()
40
+ renderer = structlog.processors.JSONRenderer()
41
+
42
+ if not log_settings.log_json: # pragma: no branch
43
+ term_width = shutil.get_terminal_size().columns
44
+ pad_event = term_width - 36
45
+ renderer: structlog.types.Processor = structlog.dev.ConsoleRenderer(
46
+ colors=True, pad_event=pad_event
47
+ )
42
48
 
43
49
  # Configure structlog
44
50
  structlog.configure(
@@ -84,10 +90,6 @@ class LoggingExtension(BaseExtension):
84
90
  self.settings = settings or Settings()
85
91
  configure_structlog(settings)
86
92
 
87
- async def startup(self, registry: svcs.Registry, app: FastAPI) -> dict[str, Any]:
88
- # app.add_middleware(RequestLoggingMiddleware)
89
- return {}
90
-
91
93
  def middleware(self) -> list[Middleware]:
92
94
  return [
93
95
  Middleware(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuneus
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: ASGI application wrapper
5
5
  Project-URL: Homepage, https://github.com/rmyers/cuneus
6
6
  Project-URL: Documentation, https://github.com/rmyers/cuneus#readme
@@ -5,11 +5,11 @@ cuneus/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cuneus/core/application.py,sha256=Xoqs3fREJ-KPzSilq4ua65JzKv6w5LgugGaMklDELdU,4376
6
6
  cuneus/core/exceptions.py,sha256=gyHgVy4UC7gBjs5pXpCzIIyIVsV7K8xt-KZKi8eLJtM,5496
7
7
  cuneus/core/extensions.py,sha256=wqN2rbaqhiTkfK_fA5AkFlefOAV2GJr6zTLf9Oi-n4c,2771
8
- cuneus/core/logging.py,sha256=YXF_-QzcNqfzIl6H4niiW3yR5IBzh2VJxUosfBvb0SM,4583
8
+ cuneus/core/logging.py,sha256=jWwtPJTNYtvOSb4etg7pglWHAKfV4iRuw4Npoqne_00,4578
9
9
  cuneus/core/settings.py,sha256=PaYXQ_ubeSt3AFpxNNErii-h1_ehHYPrajFWRT42mTI,1703
10
10
  cuneus/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cuneus/ext/health.py,sha256=5dWVVEPFL1tWFBhQwZv8C-IvZRzg28V-4sk_g1jJ0vc,3854
12
- cuneus-0.2.7.dist-info/METADATA,sha256=6xs5SVnhEMudG9taaPSruvbee6aPiaOixc9XndBD9lc,6837
13
- cuneus-0.2.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
- cuneus-0.2.7.dist-info/entry_points.txt,sha256=tzPgom-_UkpP_uLKv3V_XyoIsKg84FBAc9ddjYl0W0Y,43
15
- cuneus-0.2.7.dist-info/RECORD,,
12
+ cuneus-0.2.8.dist-info/METADATA,sha256=Y3d-3jUnaPU_GkOeHpYaxM9AmiEfnjc4WVIo4OZrYjM,6837
13
+ cuneus-0.2.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ cuneus-0.2.8.dist-info/entry_points.txt,sha256=tzPgom-_UkpP_uLKv3V_XyoIsKg84FBAc9ddjYl0W0Y,43
15
+ cuneus-0.2.8.dist-info/RECORD,,
File without changes