Commit 54dbca2
committed
CA-337000 escape non-printable characters in log msgs
To ensure that non-printable characters are logged in a readable way,
escape them using an efficient implementation:
- Any \ (0x5C) escaped to the sequence
\\ (0x5C,0x5C).
- Any byte in the ranges 0x00..0x1F and
0x7F..0xFF escaped by an e hexadecimal \xHH
escape with H a capital hexadecimal number. These bytes
are the US-ASCII control characters and non US-ASCII bytes.
- Any other byte is left unchanged.
The escaping of \ could be considered unnecessary. The main motivation
was using an existing efficient implementation.
Signed-off-by: Christian Lindig <[email protected]>1 parent 587940c commit 54dbca2
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
113 | | - | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
268 | | - | |
| 273 | + | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments