Skip to content

Commit a5bb980

Browse files
committed
docs: get rid of e.g./i.e.
1 parent f336f50 commit a5bb980

File tree

7 files changed

+24
-21
lines changed

7 files changed

+24
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
124124

125125
### Deprecated
126126

127-
- Accessing package metadata as attributes on the *structlog* module is deprecated (e.g. `structlog.__version__`).
127+
- Accessing package metadata as attributes on the *structlog* module is deprecated (for example, `structlog.__version__`).
128128
Please use [`importlib.metadata`](https://docs.python.org/3.10/library/importlib.metadata.html) instead (for Python 3.7: the [*importlib-metadata*](https://pypi.org/project/importlib-metadata/) PyPI package).
129129
- The `structlog.types` module is now deprecated in favor of the `structlog.typing` module.
130130
It seems like the Python typing community is settling on this name.
@@ -277,7 +277,7 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
277277
- *structlog* switched its packaging to [*flit*](https://flit.pypa.io/).
278278
Users shouldn't notice a difference, but (re-)packagers might.
279279
- `structlog.stdlib.AsyncBoundLogger` now determines the running loop when logging, not on instantiation.
280-
That has a minor performance impact, but makes it more robust when loops change (e.g. `aiohttp.web.run_app()`), or you want to use `sync_bl` *before* a loop has started.
280+
That has a minor performance impact, but makes it more robust when loops change (for example, `aiohttp.web.run_app()`), or you want to use `sync_bl` *before* a loop has started.
281281

282282

283283
### Fixed
@@ -331,7 +331,7 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
331331

332332
### Fixed
333333

334-
- *structlog* is now importable if `sys.stdout` is `None` (e.g. when running using `pythonw`). [#313](https://github.com/hynek/structlog/issues/313)
334+
- *structlog* is now importable if `sys.stdout` is `None` (for example, when running using `pythonw`). [#313](https://github.com/hynek/structlog/issues/313)
335335

336336

337337
## [21.1.0](https://github.com/hynek/structlog/compare/20.2.0...21.1.0) - 2021-02-18
@@ -372,7 +372,7 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
372372
- *structlog* has now type hints for all of its APIs!
373373
Since *structlog* is highly dynamic and configurable, this led to a few concessions like a specialized `structlog.stdlib.get_logger()` whose only difference to `structlog.get_logger()` is that it has the correct type hints.
374374

375-
We consider them provisional for the time being – i.e. the backwards-compatibility does not apply to them in its full strength until we feel we got it right.
375+
We consider them provisional for the time being – that means the backwards-compatibility does not apply to them in its full strength until we feel we got it right.
376376
Please feel free to provide feedback!
377377
[#223](https://github.com/hynek/structlog/issues/223),
378378
[#282](https://github.com/hynek/structlog/issues/282)
@@ -788,7 +788,7 @@ Special thanks go to [Fabian Büchler](https://github.com/fabianbuechler), [Gilb
788788
- Add `structlog.processors.ExceptionPrettyPrinter` for development and testing when multiline log entries aren't just acceptable but even helpful.
789789
- Allow the standard library name guesser to ignore certain frame names.
790790
This is useful together with frameworks.
791-
- Add meta data (e.g. function names, line numbers) extraction for wrapped stdlib loggers. [#5](https://github.com/hynek/structlog/pull/5)
791+
- Add meta data (for example, function names, line numbers) extraction for wrapped stdlib loggers. [#5](https://github.com/hynek/structlog/pull/5)
792792

793793

794794
## [0.3.2](https://github.com/hynek/structlog/compare/0.3.1...0.3.2) - 2013-09-27

docs/bound-loggers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ You will configure *structlog* as explained in the {doc}`next chapter <configura
153153

154154
However, in some rare cases you may not want to do that.
155155
For example because you don't control how you get the logger that you would like to wrap (famous example: Celery).
156-
For that times there is the {func}`structlog.wrap_logger` function that can be used to wrap a logger -- optionally without any global state (i.e. configuration):
156+
For that times there is the {func}`structlog.wrap_logger` function that can be used to wrap a logger -- optionally without any global state (in other words, configuration):
157157

158158
(proc)=
159159

docs/contextvars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ event='hi there' a=None
8585

8686
## Support for `contextvars.Token`
8787

88-
If e.g. your request handler calls a helper function that needs to temporarily override some contextvars before restoring them back to their original values, you can use the {class}`~contextvars.Token`s returned by {func}`~structlog.contextvars.bind_contextvars` along with {func}`~structlog.contextvars.reset_contextvars` to accomplish this (much like how {meth}`contextvars.ContextVar.reset` works):
88+
If, for example, your request handler calls a helper function that needs to temporarily override some contextvars before restoring them back to their original values, you can use the {class}`~contextvars.Token`s returned by {func}`~structlog.contextvars.bind_contextvars` along with {func}`~structlog.contextvars.reset_contextvars` to accomplish this (much like how {meth}`contextvars.ContextVar.reset` works):
8989

9090
```python
9191
def foo():

docs/processors.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Processors
22

33
The true power of *structlog* lies in its *combinable log processors*.
4-
A log processor is a regular callable, i.e. a function or an instance of a class with a `__call__()` method.
4+
A log processor is a regular callable or in other words:
5+
A function or an instance of a class with a `__call__()` method.
56

67
(chains)=
78

@@ -29,7 +30,7 @@ The return value of each processor is passed on to the next one as `event_dict`
2930

3031
:::{note}
3132
*structlog* only looks at the return value of the **last** processor.
32-
That means that as long as you control the next processor in the chain (i.e. the processor that will get your return value passed as an argument), you can return whatever you want.
33+
That means that as long as you control the next processor in the chain (the processor that will get your return value passed as an argument), you can return whatever you want.
3334

3435
Returning a modified event dictionary from your processors is just a convention to make processors composable.
3536
:::
@@ -95,7 +96,7 @@ But we can do better than that!
9596

9697
(cond-drop)=
9798

98-
How about dropping only log entries that are marked as coming from a certain peer (e.g. monitoring)?
99+
How about dropping only log entries that are marked as coming from a certain peer (for example, monitoring)?
99100

100101
```python
101102
class ConditionalDropper:

docs/standard-library.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ logging.basicConfig(
3030
)
3131
```
3232

33-
This will send all log messages with the [log level](https://docs.python.org/3/library/logging.html#logging-levels) `logging.INFO` and above (that means that e.g. `logging.debug` calls are ignored) to standard out without any special formatting by the standard library.
33+
This will send all log messages with the [log level](https://docs.python.org/3/library/logging.html#logging-levels) `logging.INFO` and above (that means that, for example, `logging.debug` calls are ignored) to standard out without any special formatting by the standard library.
3434

3535
If you require more complex behavior, please refer to the standard library's `logging` documentation.
3636

@@ -63,13 +63,14 @@ This means an increased computational cost per log entry, but your application w
6363
---
6464

6565

66-
*structlog* also comes with {class}`structlog.stdlib.AsyncBoundLogger` that blankly makes all logging methods asynchronous (i.e. `await log.info()`).
66+
*structlog* also comes with {class}`structlog.stdlib.AsyncBoundLogger` that blankly makes all logging methods asynchronous (in other words, you have to use `await log.info()` instead of just `log.info()`).
6767

6868
To use it, {doc}`configure <configuration>` *structlog* to use `AsyncBoundLogger` as `wrapper_class`.
6969

7070
```{versionadded} 20.2.0
7171
```
72-
72+
```{deprecated} 23.1.0
73+
```
7374

7475

7576
## Processors
@@ -118,7 +119,7 @@ To use it, {doc}`configure <configuration>` *structlog* to use `AsyncBoundLogger
118119

119120
{func}`~structlog.stdlib.PositionalArgumentsFormatter`:
120121

121-
: This processes and formats positional arguments (if any) passed to log methods in the same way the `logging` module would do, e.g. `logger.info("Hello, %s", name)`.
122+
: This processes and formats positional arguments (if any) passed to log methods in the same way the `logging` module would do, for example, `logger.info("Hello, %s", name)`.
122123

123124
*structlog* also comes with {class}`~structlog.stdlib.ProcessorFormatter` which is a `logging.Formatter` that enables you to format non-*structlog* log entries using *structlog* renderers *and* multiplex *structlog*’s output with different renderers (see [below](processor-formatter) for an example).
124125

@@ -285,7 +286,7 @@ structlog.configure(
285286
```
286287

287288
Now you have the event dict available within each log record.
288-
If you want all your log entries (i.e. also those not from your application / *structlog*) to be formatted as JSON, you can use the [*python-json-logger*] library:
289+
If you want *all* your log entries (meaning: also those not from your application / *structlog*) to be formatted as JSON, you can use the [*python-json-logger*] library:
289290

290291
```python
291292
import logging
@@ -393,7 +394,7 @@ amazing _from_structlog=True _record=<LogRecord:...> events=oh yes
393394
```
394395

395396
Of course, you probably want timestamps and log levels in your output.
396-
The `ProcessorFormatter` has a `foreign_pre_chain` argument which is responsible for adding properties to events from the standard library -- i.e. that do not originate from a *structlog* logger -- and which should in general match the `processors` argument to {func}`structlog.configure` so you get a consistent output.
397+
The `ProcessorFormatter` has a `foreign_pre_chain` argument which is responsible for adding properties to events from the standard library -- in other words, those that do not originate from a *structlog* logger -- and which should in general match the `processors` argument to {func}`structlog.configure` so you get a consistent output.
397398

398399
`_from_structlog` and `_record` allow your processors to determine whether the log entry is coming from *structlog*, and to extract information from `logging.LogRecord`s and add them to the event dictionary.
399400
However, you probably don't want to have them in your log files, thus we've added the `ProcessorFormatter.remove_processors_meta` processor to do so conveniently.

docs/why.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Since log entries are dictionaries, you can start binding and re-binding key-val
5353
2020-11-18 09:18:28 [info ] user.logged_in another_key=42 happy=True some_key=23 user=hynek
5454
```
5555

56-
You can also bind key-value pairs to {doc}`context variables <contextvars>` that look global, but are local to your thread or *asyncio* context (i.e. usually your request).
56+
You can also bind key-value pairs to {doc}`context variables <contextvars>` that look global, but are local to your thread or *asyncio* context -- which usually means your web request.
5757

5858

5959
### Powerful Pipelines

src/structlog/stdlib.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,12 @@ def wrap_for_formatter(
11131113
"""
11141114
Wrap *logger*, *name*, and *event_dict*.
11151115
1116-
The result is later unpacked by `ProcessorFormatter` when
1117-
formatting log entries.
1116+
The result is later unpacked by `ProcessorFormatter` when formatting
1117+
log entries.
11181118
1119-
Use this static method as the renderer (i.e. final processor) if you
1120-
want to use `ProcessorFormatter` in your `logging` configuration.
1119+
Use this static method as the renderer (in other words, final
1120+
processor) if you want to use `ProcessorFormatter` in your `logging`
1121+
configuration.
11211122
"""
11221123
return (event_dict,), {"extra": {"_logger": logger, "_name": name}}
11231124

0 commit comments

Comments
 (0)