Commit f942610
authored
[log_ref] support for stack traces and some engineering (ttiimm#18)
Stack traces are not part of a log message format string,
so we need to separate them out. This change adds a
regex that is run over the body to pull out Python/Java
backtraces. If a trace is detected, it is stored in the
`trace` field of the `LogDetails` struct. The `body`
field will then only contain the message body without
the trace.
In order to support this, though, the CLI needed to be
modified to handle multi-line messages. So, the binary
now reads input line-by-line and checks if it matches
the log format. If it does, it's considered the start
of a new message. If the next line/EOF also matches
the format, then we process the message. Otherwise,
we add the line to the previous lines to be processed
later.
Files:
* Cargo.toml: Add colored_json to color the output and
make it readable.
* package.json: Make pnpm version less specific
* debugAdapter.ts: Change "--end" to "--count"
* lib.rs: Add more LogError variants. Separate a
backtrace from the message body.
* main.rs: More error checking/reporting. Process input
line-by-line and support multi-line messages.
Color JSON output to make it easier to read.
Command argument changes:
- Support multiple source directories
- Change --end to --count to avoid issues with end
being less than start or having to figure out
whether it's inclusive/exclusive.1 parent 544d7ad commit f942610
File tree
22 files changed
+699
-151
lines changed- editors/code
- src
- src
- snapshots
- tests
- resources/java
- snapshots
22 files changed
+699
-151
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | 273 | | |
275 | 274 | | |
276 | 275 | | |
| |||
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
283 | | - | |
| 282 | + | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
| |||
0 commit comments