Skip to content

Commit 996552d

Browse files
authored
Merge pull request #73 from obsgolem/main
Fixed issue with extra indentation making it hard to read traces.
2 parents cdb2c5a + 68a053e commit 996552d

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

examples/no-indent.stdout

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
1:main no_indent::hierarchical-example version=0.1
22
1:main no_indent::server host="localhost", port=8080
3-
1:main Xms INFO no_indent starting
4-
1:main Xms INFO no_indent listening
3+
1:main Xms INFO no_indent starting
4+
1:main Xms INFO no_indent listening
55
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
6-
1:main Xms DEBUG no_indent connected
7-
1:main Xms DEBUG no_indent message received, length=2
6+
1:main Xms DEBUG no_indent connected
7+
1:main Xms DEBUG no_indent message received, length=2
88
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
9-
1:main Xms DEBUG no_indent connected
9+
1:main Xms DEBUG no_indent connected
1010
1:main no_indent::foomp 42 <- format string, normal_var=43
11-
1:main Xms ERROR no_indent hello
11+
1:main Xms ERROR no_indent hello
1212
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
13-
1:main Xms WARN no_indent weak encryption requested, algo="xor"
14-
1:main Xms DEBUG no_indent response sent, length=8
15-
1:main Xms DEBUG no_indent disconnected
13+
1:main Xms WARN no_indent weak encryption requested, algo="xor"
14+
1:main Xms DEBUG no_indent response sent, length=8
15+
1:main Xms DEBUG no_indent disconnected
1616
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
17-
1:main Xms DEBUG no_indent message received, length=5
18-
1:main Xms DEBUG no_indent response sent, length=8
19-
1:main Xms DEBUG no_indent disconnected
20-
1:main Xs WARN no_indent internal error
21-
1:main Xs INFO no_indent exit
17+
1:main Xms DEBUG no_indent message received, length=5
18+
1:main Xms DEBUG no_indent response sent, length=8
19+
1:main Xms DEBUG no_indent disconnected
20+
1:main Xs WARN no_indent internal error
21+
1:main Xs INFO no_indent exit

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,11 @@ where
537537
}
538538
}
539539

540+
let deindent = if self.config.indent_lines { 0 } else { 1 };
540541
// printing the indentation
541542
let indent = ctx
542543
.event_scope(event)
543-
.map(|scope| scope.count())
544+
.map(|scope| scope.count() - deindent)
544545
.unwrap_or(0);
545546

546547
// check if this event occurred in the context of a span.

0 commit comments

Comments
 (0)