structlog-config 0.7.0__tar.gz → 0.8.0__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.
- {structlog_config-0.7.0 → structlog_config-0.8.0}/PKG-INFO +2 -2
- {structlog_config-0.7.0 → structlog_config-0.8.0}/pyproject.toml +10 -3
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/__init__.py +7 -3
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/formatters.py +1 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/README.md +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/constants.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/env_config.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/environments.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/fastapi_access_logger.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/levels.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/packages.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/pytest_plugin.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/stdlib_logging.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/trace.py +0 -0
- {structlog_config-0.7.0 → structlog_config-0.8.0}/structlog_config/warnings.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: structlog-config
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: A comprehensive structlog configuration with sensible defaults for development and production environments, featuring context management, exception formatting, and path prettification.
|
|
5
5
|
Keywords: logging,structlog,json-logging,structured-logging
|
|
6
6
|
Author: Michael Bianco
|
|
7
7
|
Author-email: Michael Bianco <mike@mikebian.co>
|
|
8
8
|
Requires-Dist: orjson>=3.10.15
|
|
9
9
|
Requires-Dist: python-decouple-typed>=3.11.0
|
|
10
|
-
Requires-Dist:
|
|
10
|
+
Requires-Dist: fastapi-ipware>=0.1.1
|
|
11
11
|
Requires-Dist: structlog>=25.2.0
|
|
12
12
|
Requires-Dist: fastapi-ipware>=0.1.0 ; extra == 'fastapi'
|
|
13
13
|
Requires-Python: >=3.11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "structlog-config"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.0"
|
|
4
4
|
description = "A comprehensive structlog configuration with sensible defaults for development and production environments, featuring context management, exception formatting, and path prettification."
|
|
5
5
|
keywords = ["logging", "structlog", "json-logging", "structured-logging"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -8,7 +8,7 @@ requires-python = ">=3.11"
|
|
|
8
8
|
dependencies = [
|
|
9
9
|
"orjson>=3.10.15",
|
|
10
10
|
"python-decouple-typed>=3.11.0",
|
|
11
|
-
"
|
|
11
|
+
"fastapi_ipware>=0.1.1",
|
|
12
12
|
"structlog>=25.2.0",
|
|
13
13
|
]
|
|
14
14
|
urls = { "Repository" = "https://github.com/iloveitaly/structlog-config" }
|
|
@@ -31,6 +31,13 @@ dev = [
|
|
|
31
31
|
"fastapi>=0.115.12",
|
|
32
32
|
"httpx>=0.28.1",
|
|
33
33
|
"pytest>=8.3.3",
|
|
34
|
-
"fastapi_ipware>=0.1.0",
|
|
35
34
|
"whenever>=0.9.3",
|
|
35
|
+
"pyright[nodejs]>=1.1.380",
|
|
36
|
+
"ruff>=0.8.0",
|
|
36
37
|
]
|
|
38
|
+
|
|
39
|
+
[tool.pyright]
|
|
40
|
+
exclude = ["playground/", "tmp/", ".venv/", "tests/"]
|
|
41
|
+
|
|
42
|
+
[tool.ruff]
|
|
43
|
+
extend-exclude = ["playground.py", "playground/"]
|
|
@@ -62,12 +62,16 @@ def log_processors_for_mode(json_logger: bool) -> list[structlog.types.Processor
|
|
|
62
62
|
structlog.processors.JSONRenderer(serializer=orjson_dumps_sorted),
|
|
63
63
|
]
|
|
64
64
|
|
|
65
|
+
# Passing None skips the ConsoleRenderer default, so use the explicit dev default.
|
|
66
|
+
exception_formatter = structlog.dev.default_exception_formatter
|
|
67
|
+
|
|
68
|
+
if packages.beautiful_traceback:
|
|
69
|
+
exception_formatter = beautiful_traceback_exception_formatter
|
|
70
|
+
|
|
65
71
|
return [
|
|
66
72
|
structlog.dev.ConsoleRenderer(
|
|
67
73
|
colors=not NO_COLOR,
|
|
68
|
-
exception_formatter=
|
|
69
|
-
if packages.beautiful_traceback
|
|
70
|
-
else structlog.dev.default_exception_formatter,
|
|
74
|
+
exception_formatter=exception_formatter,
|
|
71
75
|
)
|
|
72
76
|
]
|
|
73
77
|
|
|
@@ -77,6 +77,7 @@ def beautiful_traceback_exception_formatter(sio: TextIO, exc_info: ExcInfo) -> N
|
|
|
77
77
|
from beautiful_traceback.formatting import exc_to_traceback_str
|
|
78
78
|
|
|
79
79
|
_, exc_value, traceback = exc_info
|
|
80
|
+
assert traceback is not None
|
|
80
81
|
# TODO support local_stack_only env var support
|
|
81
82
|
formatted_exception = exc_to_traceback_str(exc_value, traceback, color=not NO_COLOR)
|
|
82
83
|
sio.write("\n" + formatted_exception)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|