Skip to content

Commit 7054c94

Browse files
authored
Changeset targeting version 1.0.0-beta4 (#14)
1 parent 426eb39 commit 7054c94

9 files changed

Lines changed: 238 additions & 143 deletions

File tree

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,28 @@ jobs:
4747
- name: Test with pytest
4848
run: |
4949
pytest
50+
51+
prepare-and-test-unofficial-py39:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v6
55+
56+
- name: Set up Python 3.9
57+
uses: actions/setup-python@v6
58+
with:
59+
python-version: '3.9'
60+
cache: 'pip'
61+
cache-dependency-path: tests/test-requirements.txt
62+
63+
- name: Install pytest
64+
run: |
65+
python3 -m pip install --upgrade pip
66+
python3 -m pip install --use-pep517 'pytest>=8.0'
67+
68+
- name: Adjust certain files
69+
run: |
70+
sed -E -i -e 's/9.0/8.0/g' .pytest.toml
71+
72+
- name: Test with pytest
73+
run: |
74+
pytest

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ format is based (to a large extent) on [Keep a Changelog](https://keepachangelog
66
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77
The *public API* is documented in the [API Reference](https://certlib-log.readthedocs.io/page/reference/).
88

9+
!!! danger "Warning"
10+
11+
The `certlib.log` library is currently in the _**beta**_ stage
12+
of development. This means, in particular, that _**backward
13+
incompatible**_ changes to the public API are possible -- even
14+
if unlikely -- in any (*pre-release*) versions, _**until**_ the
15+
final _**1.0.0**_ version is released.
16+
917

1018
## [Unreleased] (2026-XX-XX)
1119

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# certlib.log
22

3-
...is a library that extends the standard **[`logging`](https://docs.python.org/3/library/logging.html)**
4-
toolset. Among other things, it makes it possible to introduce
5-
_**structured logging**_ with minimal fuss, and/or to start using the
6-
modern _**`{}`-based style of log message formatting**_ (gradually if
7-
required).
3+
`certlib.log` is a library that extends the standard [logging](https://docs.python.org/3/library/logging.html)
4+
toolset -- making it possible to introduce _**structured logging**_ with
5+
minimal fuss, and/or use the modern _**`{}`-based style**_ of log message
6+
formatting, among _**other things**_...
87

98

109
## Basic Info
@@ -20,10 +19,37 @@ the command:
2019
python3 -m pip install certlib.log
2120

2221
The library is compatible with Python 3.10 and all newer versions of
23-
Python. It uses *only* the Python standard library, i.e., it **does
22+
Python. It uses *only* the Python standard library, i.e., **it does
2423
*not* depend on any third-party packages**.
2524

2625

26+
## Principles and Benefits
27+
28+
The primary reason for creating `certlib.log` was to make it easier to
29+
configure *structured logging* across various systems created and used
30+
by [CERT Polska](https://cert.pl/en/) -- in a possibly consistent way
31+
and without spending too much time adjusting the existing stuff.
32+
33+
A **key design decision** was to build the library on top of the
34+
standard [logging](https://docs.python.org/3/library/logging.html)
35+
toolset (rather than introducing some alternative machinery).
36+
37+
In particular, this approach **makes it possible to**:
38+
39+
- start using the library in already existing projects (especially,
40+
to introduce *structured logging*) without changing a single line
41+
of code;
42+
43+
- gradually introduce selected features offered by the library
44+
(such as `{}`-style message formatting, message-less logging of pure
45+
data, or setting log entry fields automatically, e.g., from [context
46+
variables](https://docs.python.org/3/library/contextvars.html)...);
47+
48+
- retain existing logging configuration methods (whether using an
49+
[`*.ini` file](https://docs.python.org/3/library/logging.config.html#configuration-file-format),
50+
or loading a [configuration dictionary](https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema)).
51+
52+
2753
## Examples
2854

2955
### Configuring *Structured Logging* and *Auto-Makers*

dev/dev-requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# pip-compile --allow-unsafe --strip-extras dev-requirements.in
66
#
7-
ast-serialize==0.3.0
7+
ast-serialize==0.5.0
88
# via mypy
99
babel==2.18.0
1010
# via
@@ -14,7 +14,7 @@ backrefs==7.0
1414
# via
1515
# -r ../docs/doc-requirements.txt
1616
# mkdocs-material
17-
black==26.3.1
17+
black==26.5.1
1818
# via -r ../docs/doc-requirements.txt
1919
build==1.5.0
2020
# via
@@ -28,7 +28,7 @@ charset-normalizer==3.4.7
2828
# via
2929
# -r ../docs/doc-requirements.txt
3030
# requests
31-
click==8.3.3
31+
click==8.4.0
3232
# via
3333
# -r ../docs/doc-requirements.txt
3434
# black
@@ -50,7 +50,7 @@ griffelib==2.0.2
5050
# via
5151
# -r ../docs/doc-requirements.txt
5252
# mkdocstrings-python
53-
idna==3.13
53+
idna==3.15
5454
# via
5555
# -r ../docs/doc-requirements.txt
5656
# requests
@@ -64,7 +64,7 @@ jinja2==3.1.6
6464
# mkdocs
6565
# mkdocs-material
6666
# mkdocstrings
67-
librt==0.10.0
67+
librt==0.11.0
6868
# via mypy
6969
markdown==3.10.2
7070
# via
@@ -113,7 +113,7 @@ mkdocstrings==1.0.4
113113
# mkdocstrings-python
114114
mkdocstrings-python==2.0.3
115115
# via -r ../docs/doc-requirements.txt
116-
mypy==2.0.0
116+
mypy==2.1.0
117117
# via -r dev-requirements.in
118118
mypy-extensions==1.1.0
119119
# via
@@ -158,7 +158,7 @@ pygments==2.20.0
158158
# -r ../tests/test-requirements.txt
159159
# mkdocs-material
160160
# pytest
161-
pymdown-extensions==10.21.2
161+
pymdown-extensions==10.21.3
162162
# via
163163
# -r ../docs/doc-requirements.txt
164164
# mkdocs-material
@@ -188,7 +188,7 @@ pyyaml-env-tag==1.1
188188
# via
189189
# -r ../docs/doc-requirements.txt
190190
# mkdocs
191-
requests==2.33.1
191+
requests==2.34.2
192192
# via
193193
# -r ../docs/doc-requirements.txt
194194
# mkdocs-material

docs/doc-requirements.txt

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@ backrefs==7.0 \
1616
--hash=sha256:ca42ce6a49ace3d75684dfa9937f3373902a63284ecb385ce36d15e5dcb41c12 \
1717
--hash=sha256:f2c52955d631b9e1ac4cd56209f0a3a946d592b98e7790e77699339ae01c102a
1818
# via mkdocs-material
19-
black==26.3.1 \
20-
--hash=sha256:0126ae5b7c09957da2bdbd91a9ba1207453feada9e9fe51992848658c6c8e01c \
21-
--hash=sha256:0f76ff19ec5297dd8e66eb64deda23631e642c9393ab592826fd4bdc97a4bce7 \
22-
--hash=sha256:28ef38aee69e4b12fda8dba75e21f9b4f979b490c8ac0baa7cb505369ac9e1ff \
23-
--hash=sha256:2bd5aa94fc267d38bb21a70d7410a89f1a1d318841855f698746f8e7f51acd1b \
24-
--hash=sha256:2c50f5063a9641c7eed7795014ba37b0f5fa227f3d408b968936e24bc0566b07 \
25-
--hash=sha256:2d6bfaf7fd0993b420bed691f20f9492d53ce9a2bcccea4b797d34e947318a78 \
26-
--hash=sha256:41cd2012d35b47d589cb8a16faf8a32ef7a336f56356babd9fcf70939ad1897f \
27-
--hash=sha256:474c27574d6d7037c1bc875a81d9be0a9a4f9ee95e62800dab3cfaadbf75acd5 \
28-
--hash=sha256:5602bdb96d52d2d0672f24f6ffe5218795736dd34807fd0fd55ccd6bf206168b \
29-
--hash=sha256:5e9d0d86df21f2e1677cc4bd090cd0e446278bcbbe49bf3659c308c3e402843e \
30-
--hash=sha256:5ed0ca58586c8d9a487352a96b15272b7fa55d139fc8496b519e78023a8dab0a \
31-
--hash=sha256:6c54a4a82e291a1fee5137371ab488866b7c86a3305af4026bdd4dc78642e1ac \
32-
--hash=sha256:6e131579c243c98f35bce64a7e08e87fb2d610544754675d4a0e73a070a5aa3a \
33-
--hash=sha256:855822d90f884905362f602880ed8b5df1b7e3ee7d0db2502d4388a954cc8c54 \
34-
--hash=sha256:86a8b5035fce64f5dcd1b794cf8ec4d31fe458cf6ce3986a30deb434df82a1d2 \
35-
--hash=sha256:8a33d657f3276328ce00e4d37fe70361e1ec7614da5d7b6e78de5426cb56332f \
36-
--hash=sha256:92c0ec1f2cc149551a2b7b47efc32c866406b6891b0ee4625e95967c8f4acfb1 \
37-
--hash=sha256:9a5e9f45e5d5e1c5b5c29b3bd4265dcc90e8b92cf4534520896ed77f791f4da5 \
38-
--hash=sha256:afc622538b430aa4c8c853f7f63bc582b3b8030fd8c80b70fb5fa5b834e575c2 \
39-
--hash=sha256:b07fc0dab849d24a80a29cfab8d8a19187d1c4685d8a5e6385a5ce323c1f015f \
40-
--hash=sha256:b5e6f89631eb88a7302d416594a32faeee9fb8fb848290da9d0a5f2903519fc1 \
41-
--hash=sha256:bf9bf162ed91a26f1adba8efda0b573bc6924ec1408a52cc6f82cb73ec2b142c \
42-
--hash=sha256:c7e72339f841b5a237ff14f7d3880ddd0fc7f98a1199e8c4327f9a4f478c1839 \
43-
--hash=sha256:ddb113db38838eb9f043623ba274cfaf7d51d5b0c22ecb30afe58b1bb8322983 \
44-
--hash=sha256:dfdd51fc3e64ea4f35873d1b3fb25326773d55d2329ff8449139ebaad7357efb \
45-
--hash=sha256:f1cd08e99d2f9317292a311dfe578fd2a24b15dbce97792f9c4d752275c1fa56 \
46-
--hash=sha256:f89f2ab047c76a9c03f78d0d66ca519e389519902fa27e7a91117ef7611c0568
19+
black==26.5.1 \
20+
--hash=sha256:0e48b87e03bf109288e55cfceadcfa15ff5470aca2851a851950ed2926f450d7 \
21+
--hash=sha256:1037d5ac7b7b310b2632ad867ec8d0e4c4819dcdb0b820f63135da746a24e418 \
22+
--hash=sha256:1ef92b76f7733f282fd096ea406200b5a286c42947412b0eaff3a74e3616cefe \
23+
--hash=sha256:1f7ea64ebfa01b50f693508fc39f875e264446d3b097088f84f203b9d09618a0 \
24+
--hash=sha256:22f2cd76d069cc54c71f10360744ba8983fbb616903b4304a85b734915c8e1b4 \
25+
--hash=sha256:2b36cf2ddf5566e205f6535f782a62194a184d33e175b64ae8c40b1737522be3 \
26+
--hash=sha256:30d3c14661f2792e9142cce3eeeb1cbc175b3eb5f733be0c8eeb99651e52b0c3 \
27+
--hash=sha256:32d5ea7f6c8bdfa6e648326ebca1f02b0764e2a029edc6f8dce2627e19d468c3 \
28+
--hash=sha256:3915f256e75a2d7cf88d8953d37f780455dc586cc72dee059c528fe77f581217 \
29+
--hash=sha256:4ad6fa01f941920f54f2bbb35f3df7673428a0ef98a0b0840c2eaef3b110efa8 \
30+
--hash=sha256:4ed7f7da04046d2e488437170797d3b4a4ad83906683bcb7dfc68b673bbce5e2 \
31+
--hash=sha256:5119fa92ae61f786e8c3662fd60aece1d0a2dd5cca5d0c79417a95e7a4272a59 \
32+
--hash=sha256:577f21094ea469ef92ec1adaf2c9441a226d2144d01a5be2fa823cecf6543e50 \
33+
--hash=sha256:58b4bd92cf88aacf83d88479c8f9caee044b1ec55f2451a337354a7ea2590a22 \
34+
--hash=sha256:5c34b25da232ead53a6f335b76dbea124f4d152ad568b9080d6f944bc2b34b52 \
35+
--hash=sha256:87ed5c6f450580a2f6790bc7cbfb016dfc73bc750249762268a3695361315eef \
36+
--hash=sha256:89c93167a74d3a75dfaa38a5c7cca015537d5820dd7f17d63267d674a61cae90 \
37+
--hash=sha256:96ae2c733b2aabdd9986e2c5df628ff3473676cd1c5faded1ff496cf6d74083c \
38+
--hash=sha256:9942db8888e06943c5dde66ca0037dcff82a2a4ec1ad0ada9e0d2ee9d9823893 \
39+
--hash=sha256:9d98d4137277c75dfb898ec8d846c4fd68ba1e9cf77f95e2865c203dc18f4c3d \
40+
--hash=sha256:a1dca32d9f1784af512a13410ec204c6f7f0aa9797a111c42e1c03449821c264 \
41+
--hash=sha256:dd321f668053961824bcc1be1cc1df748b2d7e4fa28086b08331e577b0100a73 \
42+
--hash=sha256:e1a26503279b6b310669fb0b219c39e4820b77e8189fe80f522bb511f247db0a \
43+
--hash=sha256:e88976690a64b0af98312ca958415849cb42423423c5f2ee74af4b49a97a2168 \
44+
--hash=sha256:ea8d16dc41655aa113cd64665e7219446cd7e4ff2248d7178eaa905190c86b18 \
45+
--hash=sha256:ecb3e624844c798144e9bd986954e0adc81d8911a1f30f375e1252fe26e8c294 \
46+
--hash=sha256:ed1a20af114c301a0269bf01163d51dbef72737fd65f850001e7cbe7f3c7abae
4747
# via -r doc-requirements.in
4848
certifi==2026.4.22 \
4949
--hash=sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a \
@@ -180,9 +180,9 @@ charset-normalizer==3.4.7 \
180180
--hash=sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79 \
181181
--hash=sha256:fea24543955a6a729c45a73fe90e08c743f0b3334bbf3201e6c4bc1b0c7fa464
182182
# via requests
183-
click==8.3.3 \
184-
--hash=sha256:398329ad4837b2ff7cbe1dd166a4c0f8900c3ca3a218de04466f38f6497f18a2 \
185-
--hash=sha256:a2bf429bb3033c89fa4936ffb35d5cb471e3719e1f3c8a7c3fff0b8314305613
183+
click==8.4.0 \
184+
--hash=sha256:40c50b7c6c6adac2823d411041ec84f3f103f1b280d5e9ce0d7f998995832f81 \
185+
--hash=sha256:638f1338fe1235c8f4e008e4a8a254fb5c5fbdcbb40ece3c9142ebb78e792973
186186
# via
187187
# black
188188
# mkdocs
@@ -198,9 +198,9 @@ griffelib==2.0.2 \
198198
--hash=sha256:3cf20b3bc470e83763ffbf236e0076b1211bac1bc67de13daf494640f2de707e \
199199
--hash=sha256:925c857658fb1ba40c0772c37acbc2ab650bd794d9c1b9726922e36ea4117ea1
200200
# via mkdocstrings-python
201-
idna==3.13 \
202-
--hash=sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242 \
203-
--hash=sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3
201+
idna==3.15 \
202+
--hash=sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8 \
203+
--hash=sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc
204204
# via requests
205205
jinja2==3.1.6 \
206206
--hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \
@@ -385,9 +385,9 @@ pygments==2.20.0 \
385385
--hash=sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f \
386386
--hash=sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176
387387
# via mkdocs-material
388-
pymdown-extensions==10.21.2 \
389-
--hash=sha256:5c0fd2a2bea14eb39af8ff284f1066d898ab2187d81b889b75d46d4348c01638 \
390-
--hash=sha256:c3f55a5b8a1d0edf6699e35dcbea71d978d34ff3fa79f3d807b8a5b3fa90fbdc
388+
pymdown-extensions==10.21.3 \
389+
--hash=sha256:72cfcf55f07aea0d4af2c4f11dd4e52466ddfb1bb819673146398e0bd3a77354 \
390+
--hash=sha256:d7a5d08014fc571e80ca21dd6f854e31f94c489800350564d55d15b3c41e76b6
391391
# via
392392
# mkdocs-material
393393
# mkdocstrings
@@ -522,9 +522,9 @@ pyyaml-env-tag==1.1 \
522522
--hash=sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04 \
523523
--hash=sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff
524524
# via mkdocs
525-
requests==2.33.1 \
526-
--hash=sha256:18817f8c57c6263968bc123d237e3b8b08ac046f5456bd1e307ee8f4250d3517 \
527-
--hash=sha256:4e6d1ef462f3626a1f0a0a9c42dd93c63bad33f9f1c1937509b8c5c8718ab56a
525+
requests==2.34.2 \
526+
--hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \
527+
--hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed
528528
# via mkdocs-material
529529
six==1.17.0 \
530530
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \

docs/doc-src/reference.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,45 @@
44

55
The `certlib.log` library is currently in the _**beta**_ stage
66
of development. This means, in particular, that _**backward
7-
incompatible**_ changes to the public API are still possible
8-
(even if unlikely) in *non-major* versions -- _**until**_ the
7+
incompatible**_ changes to the public API are possible -- even
8+
if unlikely -- in any (*pre-release*) versions, _**until**_ the
99
final _**1.0.0**_ version is released.
1010

11-
***
11+
## General Remarks
12+
13+
The `certlib.log` library is compatible with Python 3.10 and all newer
14+
versions of Python.
15+
16+
An **important definition**: whenever this document refers to
17+
_**undefined behavior**_, this should be understood to mean: *the
18+
API makes no guarantees about what will happen -- an exception or
19+
a malfunction is likely.*
20+
21+
Unless otherwise specified, using the library in a way that
22+
contravenes the documented API results in *undefined behavior*.
1223

1324
!!! exclusion "Interface exclusion"
1425

15-
In general, the following elements are _**not**_ part of the public
16-
API (so, in particular, they may change in *minor* or *patch* versions
17-
of the `certlib.log` library):
26+
The following elements/features are _**not**_ part of the API (so,
27+
in particular, they may change or disappear in *minor* or *patch*
28+
versions of the library):
1829

19-
* any elements *not* documented in this *API reference*;
30+
* any elements *not* documented in this *API reference* as well as
31+
elements that appear only in source code excerpts (available via
32+
`<> Source code...` drop-down widgets), e.g., specific exception
33+
messages;
2034

21-
* specific *runtime types* of any objects bound to a documented
22-
element of the API (variable, attribute, parameter or call
23-
result) -- *provided that* they remain correct with respect to
24-
the element's type annotation, according to the [static typing
35+
* specific *runtime types* of any objects bound to an element
36+
of the API (variable, attribute, parameter or call result),
37+
*provided that* they remain correct with respect to the
38+
element's type annotation, according to the [static typing
2539
rules](https://typing.python.org/en/latest/spec/index.html);
2640

2741
* specific behaviors in cases where -- according to the
28-
documentation -- *undefined behavior* is expected;
29-
30-
* any elements that appear in this document *only* in source code
31-
excerpts (available via `<> Source code...` drop-down widgets),
32-
e.g., specific exception messages.
33-
34-
!!! warning "Important"
42+
documentation -- *undefined behavior* is expected (see
43+
the definition above);
3544

36-
Whenever this document refers to *undefined behavior*, this should
37-
be understood to mean: *the API makes no guarantees about what will
38-
happen -- an exception or a malfunction is likely.*
45+
* the *unofficial* support for Python 3.9.
3946

4047
***
4148

@@ -115,7 +122,7 @@
115122
The flavor of any *type aliases* -- i.e., whether they are
116123
[`TypeAlias`][typing.TypeAlias]-annotated ones or [*type
117124
statement*](https://docs.python.org/3/reference/simple_stmts.html#type)-made
118-
ones -- is _**not**_ part of the public API.
125+
ones -- is _**not**_ part of the API.
119126

120127
::: certlib.log.ValueProvider
121128
handler: python

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ description = """\
1111
A library extending the standard logging toolbox \
1212
(e.g., facilitating structured logging with minimal fuss).\
1313
"""
14-
requires-python = ">=3.10"
14+
# TODO: update this after dropping unofficial support for Py3.9:
15+
requires-python = ">=3.9"
1516

1617
readme = "README.md"
1718
maintainers = [

0 commit comments

Comments
 (0)