ganicas-package 0.1.3__tar.gz → 0.1.4__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.
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/PKG-INFO +11 -11
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/README.md +10 -10
- ganicas_package-0.1.4/ganicas_utils/logging/__pycache__/__init__.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/__pycache__/configuration.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/__pycache__/formatter.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/__pycache__/logger.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/configuration.py +1 -1
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/pyproject.toml +1 -1
- ganicas_package-0.1.3/ganicas_utils/logging/__pycache__/__init__.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/__init__.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/config.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/__init__.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/__pycache__/middlewares.cpython-312.pyc +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/formatter.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/logger.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/middlewares.py +0 -0
- {ganicas_package-0.1.3 → ganicas_package-0.1.4}/ganicas_utils/logging/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ganicas-package
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.4
|
4
4
|
Summary: Ganicas internal Python package for structured logging and utilities.
|
5
5
|
Keywords: logging,utilities,internal-package
|
6
6
|
Author: Ganicas
|
@@ -33,8 +33,8 @@ More details can be found in the [structlog](https://www.structlog.org/en/stable
|
|
33
33
|
instead of `logger = logging.getLogger(__name__)` it is `logger = structlog.get_logger(__name__)`
|
34
34
|
|
35
35
|
```python
|
36
|
-
from
|
37
|
-
from
|
36
|
+
from ganicas_utils.logging import LoggingConfigurator
|
37
|
+
from ganicas_utils.config import Config
|
38
38
|
import structlog
|
39
39
|
|
40
40
|
config = Config()
|
@@ -68,8 +68,8 @@ instead of `logger = logging.getLogger(__name__)` it is `logger = structlog.get_
|
|
68
68
|
In production, you should aim for structured, machine-readable logs that can be easily ingested by log aggregation and monitoring tools like ELK (Elasticsearch, Logstash, Kibana), Datadog, or Prometheus:
|
69
69
|
|
70
70
|
```python
|
71
|
-
from
|
72
|
-
from
|
71
|
+
from ganicas_utils.logging import LoggingConfigurator
|
72
|
+
from ganicas_utils.config import Config
|
73
73
|
import structlog
|
74
74
|
|
75
75
|
config = Config()
|
@@ -121,9 +121,9 @@ The logger is initialized once in the main application file (e.g., app.py).
|
|
121
121
|
import sys
|
122
122
|
import uuid
|
123
123
|
from flask import Flask, request
|
124
|
-
from
|
125
|
-
from
|
126
|
-
from
|
124
|
+
from ganicas_utils.logging import LoggingConfigurator
|
125
|
+
from ganicas_utils.logging.middlewares import add_request_context_flask
|
126
|
+
from ganicas_utils.config import Config
|
127
127
|
import structlog
|
128
128
|
|
129
129
|
config = Config()
|
@@ -175,7 +175,7 @@ FastAPI:
|
|
175
175
|
```python
|
176
176
|
import uuid
|
177
177
|
from fastapi import FastAPI, Request
|
178
|
-
from
|
178
|
+
from ganicas_utils.logging.middlewares import FastAPIRequestContextMiddleware
|
179
179
|
import structlog
|
180
180
|
|
181
181
|
config = Config()
|
@@ -217,11 +217,11 @@ This a console view, in prod it will be json (using python json logging to have
|
|
217
217
|
|
218
218
|
Please install [poetry](https://python-poetry.org/docs/#installation) as this is the tool we use for releasing and development.
|
219
219
|
|
220
|
-
poetry install && poetry run pytest -rs --cov=
|
220
|
+
poetry install && poetry run pytest -rs --cov=ganicas_utils -s
|
221
221
|
|
222
222
|
To run tests inside docker:
|
223
223
|
|
224
|
-
poetry install --with dev && poetry run pytest -rs --cov=
|
224
|
+
poetry install --with dev && poetry run pytest -rs --cov=ganicas_utils
|
225
225
|
|
226
226
|
To run pre-commit:
|
227
227
|
poetry run pre-commit run --all-files
|
@@ -9,8 +9,8 @@ More details can be found in the [structlog](https://www.structlog.org/en/stable
|
|
9
9
|
instead of `logger = logging.getLogger(__name__)` it is `logger = structlog.get_logger(__name__)`
|
10
10
|
|
11
11
|
```python
|
12
|
-
from
|
13
|
-
from
|
12
|
+
from ganicas_utils.logging import LoggingConfigurator
|
13
|
+
from ganicas_utils.config import Config
|
14
14
|
import structlog
|
15
15
|
|
16
16
|
config = Config()
|
@@ -44,8 +44,8 @@ instead of `logger = logging.getLogger(__name__)` it is `logger = structlog.get_
|
|
44
44
|
In production, you should aim for structured, machine-readable logs that can be easily ingested by log aggregation and monitoring tools like ELK (Elasticsearch, Logstash, Kibana), Datadog, or Prometheus:
|
45
45
|
|
46
46
|
```python
|
47
|
-
from
|
48
|
-
from
|
47
|
+
from ganicas_utils.logging import LoggingConfigurator
|
48
|
+
from ganicas_utils.config import Config
|
49
49
|
import structlog
|
50
50
|
|
51
51
|
config = Config()
|
@@ -97,9 +97,9 @@ The logger is initialized once in the main application file (e.g., app.py).
|
|
97
97
|
import sys
|
98
98
|
import uuid
|
99
99
|
from flask import Flask, request
|
100
|
-
from
|
101
|
-
from
|
102
|
-
from
|
100
|
+
from ganicas_utils.logging import LoggingConfigurator
|
101
|
+
from ganicas_utils.logging.middlewares import add_request_context_flask
|
102
|
+
from ganicas_utils.config import Config
|
103
103
|
import structlog
|
104
104
|
|
105
105
|
config = Config()
|
@@ -151,7 +151,7 @@ FastAPI:
|
|
151
151
|
```python
|
152
152
|
import uuid
|
153
153
|
from fastapi import FastAPI, Request
|
154
|
-
from
|
154
|
+
from ganicas_utils.logging.middlewares import FastAPIRequestContextMiddleware
|
155
155
|
import structlog
|
156
156
|
|
157
157
|
config = Config()
|
@@ -193,11 +193,11 @@ This a console view, in prod it will be json (using python json logging to have
|
|
193
193
|
|
194
194
|
Please install [poetry](https://python-poetry.org/docs/#installation) as this is the tool we use for releasing and development.
|
195
195
|
|
196
|
-
poetry install && poetry run pytest -rs --cov=
|
196
|
+
poetry install && poetry run pytest -rs --cov=ganicas_utils -s
|
197
197
|
|
198
198
|
To run tests inside docker:
|
199
199
|
|
200
|
-
poetry install --with dev && poetry run pytest -rs --cov=
|
200
|
+
poetry install --with dev && poetry run pytest -rs --cov=ganicas_utils
|
201
201
|
|
202
202
|
To run pre-commit:
|
203
203
|
poetry run pre-commit run --all-files
|
Binary file
|
Binary file
|
Binary file
|
@@ -14,7 +14,7 @@ def get_default_logging_conf(log_level: str, formatter: str, formatter_std_lib:
|
|
14
14
|
"format": "%(asctime)s %(levelname)s %(name)s %(message)s",
|
15
15
|
},
|
16
16
|
"json_formatter": {
|
17
|
-
"()": "
|
17
|
+
"()": "ganicas_utils.logging.formatter.LogFormatter",
|
18
18
|
},
|
19
19
|
"plain_console": {
|
20
20
|
"()": structlog.stdlib.ProcessorFormatter,
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|