Skip to content

Commit 98c48fd

Browse files
committed
fix: ensure keys are unique without losing any arguments
1 parent a92028e commit 98c48fd

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

docs/docs/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
## Unreleased
22

3+
### Fix
4+
5+
- ensure keys are unique without losing any arguments
6+
7+
## 1.2.1 (2023-02-25)
8+
9+
### Fix
10+
11+
- resolve bugs in tail-jsonl config-path parsing
12+
13+
## 1.2.0 (2023-02-25)
14+
15+
### Feat
16+
17+
- update color scheme and resolve log issues
18+
319
### Refactor
420

521
- migrate to corallium's rich_printer and styles

docs/docs/DEVELOPER_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ poetry config pypi-token.pypi ...
4848
|-----------------------------------|--------------|-----------|------------|------------|
4949
| `tail_jsonl/__init__.py` | 3 | 0 | 0 | 100.0% |
5050
| `tail_jsonl/_private/__init__.py` | 0 | 0 | 0 | 100.0% |
51-
| `tail_jsonl/_private/core.py` | 47 | 1 | 0 | 97.9% |
51+
| `tail_jsonl/_private/core.py` | 49 | 1 | 0 | 98.0% |
5252
| `tail_jsonl/config.py` | 11 | 0 | 0 | 100.0% |
53-
| `tail_jsonl/scripts.py` | 18 | 0 | 10 | 100.0% |
54-
| **Totals** | 79 | 1 | 10 | 98.7% |
53+
| `tail_jsonl/scripts.py` | 18 | 0 | 11 | 100.0% |
54+
| **Totals** | 81 | 1 | 11 | 98.8% |
5555

5656
Generated on: 2023-02-25
5757
<!-- {cte} -->

tail_jsonl/_private/core.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def print_record(line: str, console: Console, config: Config) -> None:
7474
record.data['_level_name'] = record.level
7575

7676
printer_kwargs = {
77-
**record.data,
78-
# Ensure that there is no repeat keyword arguments
7977
'message': record.message,
8078
'is_header': False,
8179
'_this_level': _this_level,
@@ -85,4 +83,9 @@ def print_record(line: str, console: Console, config: Config) -> None:
8583
'_keys_on_own_line': config.keys.on_own_line,
8684
'timestamp': record.timestamp,
8785
}
88-
rich_printer(**printer_kwargs)
86+
keys = set(printer_kwargs)
87+
rich_printer(
88+
**printer_kwargs,
89+
# Ensure that there is no repeat keyword arguments
90+
**{f'_{key}' if key in keys else key: value for key, value in record.data.items()},
91+
)

0 commit comments

Comments
 (0)