Skip to content

Commit c23de80

Browse files
gr4vitonunderyx
authored andcommitted
highlighter_processor: add text is none condition
1 parent 74befcc commit c23de80

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 0.3.0 (2020-07-08)
4+
5+
- Fix SyntaxHighlighter - skip code highlighting when there is no code to highlight.
6+
7+
38
## 0.2.0 (2020-07-08)
49

510
- Fix JSONPrettifier, XMLPrettifier - skip code coloring when there is no code to color.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name='structlog-pretty',
18-
version='0.2.0',
18+
version='0.3.0',
1919
url='https://github.com/underyx/structlog-pretty',
2020
author='Bence Nagy',
2121
author_email='[email protected]',

structlog_pretty/processors.py

+2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ def __call__(self, _, __, event_dict):
169169
code = event_dict[field]
170170
except KeyError:
171171
continue
172+
if not code:
173+
continue
172174
event_dict[field] = highlight(code, lexer, TerminalFormatter())
173175

174176
return event_dict

0 commit comments

Comments
 (0)