fluidattacks_utils_logger 2.0.0__tar.gz → 2.1.1__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.
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/PKG-INFO +2 -2
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/__init__.py +2 -2
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/handlers.py +11 -2
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/pyproject.toml +1 -1
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/test_logger.py +19 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/uv.lock +8 -8
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/.envrc +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/build/default.nix +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/build/filter.nix +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/flake.lock +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/flake.nix +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/env.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/levels.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/logger.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/py.typed +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/mypy.ini +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/ruff.toml +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/__init__.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/arch/__init__.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/arch/arch.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/arch/test_arch.py +0 -0
- {fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/tests/py.typed +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fluidattacks_utils_logger
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: Common logger handlers
|
|
5
5
|
Author-email: Product Team <development@fluidattacks.com>
|
|
6
6
|
Requires-Python: >=3.11
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
8
8
|
Requires-Dist: bugsnag >=4.7.0, <5.0.0
|
|
9
|
-
Requires-Dist: fluidattacks-core >=
|
|
9
|
+
Requires-Dist: fluidattacks-core >=4.0.0, <5.0.0
|
|
10
10
|
Requires-Dist: fa-purity >=2.5.2, <3.0.0
|
|
@@ -16,7 +16,7 @@ from .levels import (
|
|
|
16
16
|
LoggingLvl,
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
-
__version__ = "2.
|
|
19
|
+
__version__ = "2.1.1"
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def set_main_log(
|
|
@@ -25,7 +25,7 @@ def set_main_log(
|
|
|
25
25
|
debug: bool,
|
|
26
26
|
) -> Cmd[None]:
|
|
27
27
|
_bug_handler = handlers.bug_handler(conf, LoggingLvl.ERROR)
|
|
28
|
-
_log_handler = handlers.logger_handler(sys.stderr)
|
|
28
|
+
_log_handler = handlers.logger_handler(conf, sys.stderr)
|
|
29
29
|
_handlers = (_log_handler, _bug_handler)
|
|
30
30
|
env = current_app_env()
|
|
31
31
|
display_env = logger.get_logger(name).bind(
|
|
@@ -16,6 +16,11 @@ from bugsnag.handlers import (
|
|
|
16
16
|
from fa_purity import (
|
|
17
17
|
Cmd,
|
|
18
18
|
)
|
|
19
|
+
from fluidattacks_core.logging import (
|
|
20
|
+
set_product_environment,
|
|
21
|
+
set_product_id,
|
|
22
|
+
set_product_version,
|
|
23
|
+
)
|
|
19
24
|
from fluidattacks_core.logging.formatters import (
|
|
20
25
|
ColorfulFormatter,
|
|
21
26
|
CustomJsonFormatter,
|
|
@@ -59,10 +64,14 @@ def bug_handler(conf: LoggingConf, min_lvl: LoggingLvl) -> Cmd[Handler]:
|
|
|
59
64
|
|
|
60
65
|
|
|
61
66
|
def logger_handler_with_env(
|
|
67
|
+
conf: LoggingConf,
|
|
62
68
|
target: IO[str],
|
|
63
69
|
env: Envs,
|
|
64
70
|
) -> Cmd[Handler]:
|
|
65
71
|
def _action() -> Handler:
|
|
72
|
+
set_product_id(conf.app_name)
|
|
73
|
+
set_product_environment(conf.release_stage.value)
|
|
74
|
+
set_product_version(conf.app_version)
|
|
66
75
|
formatter = CustomJsonFormatter() if env == Envs.PROD else ColorfulFormatter()
|
|
67
76
|
handler = logging.StreamHandler(target)
|
|
68
77
|
handler.setFormatter(formatter)
|
|
@@ -71,5 +80,5 @@ def logger_handler_with_env(
|
|
|
71
80
|
return Cmd.wrap_impure(_action)
|
|
72
81
|
|
|
73
82
|
|
|
74
|
-
def logger_handler(target: IO[str]) -> Cmd[Handler]:
|
|
75
|
-
return current_app_env().bind(lambda env: logger_handler_with_env(target, env))
|
|
83
|
+
def logger_handler(conf: LoggingConf, target: IO[str]) -> Cmd[Handler]:
|
|
84
|
+
return current_app_env().bind(lambda env: logger_handler_with_env(conf, target, env))
|
|
@@ -5,7 +5,7 @@ classifiers = ["License :: OSI Approved :: MIT License"]
|
|
|
5
5
|
requires-python = ">=3.11"
|
|
6
6
|
dependencies = [
|
|
7
7
|
"bugsnag >=4.7.0, <5.0.0",
|
|
8
|
-
"fluidattacks-core >=
|
|
8
|
+
"fluidattacks-core >=4.0.0, <5.0.0",
|
|
9
9
|
"fa-purity >=2.5.2, <3.0.0",
|
|
10
10
|
]
|
|
11
11
|
description = "Common logger handlers"
|
|
@@ -13,6 +13,7 @@ from fluidattacks_utils_logger.env import (
|
|
|
13
13
|
Envs,
|
|
14
14
|
)
|
|
15
15
|
from fluidattacks_utils_logger.handlers import (
|
|
16
|
+
LoggingConf,
|
|
16
17
|
logger_handler_with_env,
|
|
17
18
|
)
|
|
18
19
|
from fluidattacks_utils_logger.levels import (
|
|
@@ -52,6 +53,15 @@ def test_json_formatter_in_production() -> None:
|
|
|
52
53
|
lvl=LoggingLvl.INFO,
|
|
53
54
|
handlers=(
|
|
54
55
|
logger_handler_with_env(
|
|
56
|
+
conf=LoggingConf(
|
|
57
|
+
app_type="etl",
|
|
58
|
+
app_version="1.0.0",
|
|
59
|
+
project_root=".",
|
|
60
|
+
auto_capture_sessions=False,
|
|
61
|
+
api_key="test",
|
|
62
|
+
release_stage=Envs.PROD,
|
|
63
|
+
app_name="observes",
|
|
64
|
+
),
|
|
55
65
|
target=output_stream,
|
|
56
66
|
env=Envs.PROD,
|
|
57
67
|
),
|
|
@@ -84,6 +94,15 @@ def test_colorful_formatter_in_development() -> None:
|
|
|
84
94
|
lvl=LoggingLvl.INFO,
|
|
85
95
|
handlers=(
|
|
86
96
|
logger_handler_with_env(
|
|
97
|
+
conf=LoggingConf(
|
|
98
|
+
app_type="etl",
|
|
99
|
+
app_version="1.0.0",
|
|
100
|
+
project_root=".",
|
|
101
|
+
auto_capture_sessions=False,
|
|
102
|
+
api_key="test",
|
|
103
|
+
release_stage=Envs.DEV,
|
|
104
|
+
app_name="observes",
|
|
105
|
+
),
|
|
87
106
|
target=output_stream,
|
|
88
107
|
env=Envs.DEV,
|
|
89
108
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version = 1
|
|
2
|
-
revision =
|
|
2
|
+
revision = 2
|
|
3
3
|
requires-python = ">=3.11"
|
|
4
4
|
resolution-markers = [
|
|
5
5
|
"python_full_version >= '3.13'",
|
|
@@ -301,7 +301,7 @@ wheels = [
|
|
|
301
301
|
|
|
302
302
|
[[package]]
|
|
303
303
|
name = "fluidattacks-core"
|
|
304
|
-
version = "
|
|
304
|
+
version = "4.2.0"
|
|
305
305
|
source = { registry = "https://pypi.org/simple" }
|
|
306
306
|
dependencies = [
|
|
307
307
|
{ name = "aiohttp" },
|
|
@@ -310,9 +310,9 @@ dependencies = [
|
|
|
310
310
|
{ name = "simplejson" },
|
|
311
311
|
{ name = "urllib3" },
|
|
312
312
|
]
|
|
313
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
313
|
+
sdist = { url = "https://files.pythonhosted.org/packages/3d/fc/3624afa568cf44ca0b9f8a09e49b10bf19b48f41bd20d9082b798578e6b6/fluidattacks_core-4.2.0.tar.gz", hash = "sha256:2ece345a351df013aa2db00a69f6dfa83e26987357b6ba4a58fd6d98fd7ed8b7", size = 65540, upload-time = "2025-12-16T02:45:34.23Z" }
|
|
314
314
|
wheels = [
|
|
315
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
315
|
+
{ url = "https://files.pythonhosted.org/packages/65/b5/78892e54df36b02c4e2dca78e758dc4d7b99d554a003797c8c8195de65fb/fluidattacks_core-4.2.0-py3-none-any.whl", hash = "sha256:30c41a46bbf8a2fdec62150f733eaa8f7c55d8cdf8ca76dd1c0d9668bfb758e6", size = 67860, upload-time = "2025-12-16T02:45:32.784Z" },
|
|
316
316
|
]
|
|
317
317
|
|
|
318
318
|
[[package]]
|
|
@@ -337,7 +337,7 @@ dev = [
|
|
|
337
337
|
requires-dist = [
|
|
338
338
|
{ name = "bugsnag", specifier = ">=4.7.0,<5.0.0" },
|
|
339
339
|
{ name = "fa-purity", specifier = ">=2.5.2,<3.0.0" },
|
|
340
|
-
{ name = "fluidattacks-core", specifier = ">=
|
|
340
|
+
{ name = "fluidattacks-core", specifier = ">=4.0.0,<5.0.0" },
|
|
341
341
|
]
|
|
342
342
|
|
|
343
343
|
[package.metadata.requires-dev]
|
|
@@ -974,11 +974,11 @@ wheels = [
|
|
|
974
974
|
|
|
975
975
|
[[package]]
|
|
976
976
|
name = "urllib3"
|
|
977
|
-
version = "2.
|
|
977
|
+
version = "2.6.1"
|
|
978
978
|
source = { registry = "https://pypi.org/simple" }
|
|
979
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
979
|
+
sdist = { url = "https://files.pythonhosted.org/packages/5e/1d/0f3a93cca1ac5e8287842ed4eebbd0f7a991315089b1a0b01c7788aa7b63/urllib3-2.6.1.tar.gz", hash = "sha256:5379eb6e1aba4088bae84f8242960017ec8d8e3decf30480b3a1abdaa9671a3f", size = 432678, upload-time = "2025-12-08T15:25:26.773Z" }
|
|
980
980
|
wheels = [
|
|
981
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
981
|
+
{ url = "https://files.pythonhosted.org/packages/bc/56/190ceb8cb10511b730b564fb1e0293fa468363dbad26145c34928a60cb0c/urllib3-2.6.1-py3-none-any.whl", hash = "sha256:e67d06fe947c36a7ca39f4994b08d73922d40e6cca949907be05efa6fd75110b", size = 131138, upload-time = "2025-12-08T15:25:25.51Z" },
|
|
982
982
|
]
|
|
983
983
|
|
|
984
984
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_utils_logger-2.0.0 → fluidattacks_utils_logger-2.1.1}/fluidattacks_utils_logger/env.py
RENAMED
|
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
|