Skip to content

Commit 6343af7

Browse files
author
Aaron Blankstein
authored
Merge pull request #2268 from blockstack/feat/thread-names-json
Chore: use thread names in slog_json as well
2 parents 5dd6314 + ae8f3ae commit 6343af7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util/log.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ fn make_json_logger() -> Logger {
110110
info.line()
111111
}),
112112
"thread" => FnValue(move |_| {
113-
format!("{:?}", thread::current().id())
113+
match thread::current().name() {
114+
None => format!("{:?}", thread::current().id()),
115+
Some(name) => name.to_string(),
116+
}
114117
}),
115118
);
116119

0 commit comments

Comments
 (0)