logging: fix logging empty thread name#25256
Conversation
src/leveldb/util/env_posix.cc
Outdated
There was a problem hiding this comment.
I'm not sure what would be a good way to do this, but we shouldn't make changes to upstream leveldb here.
There was a problem hiding this comment.
Agreed, remove the commit that modifies leveldb.
|
@klementtan do you wish to add the configuration option and logging RPC option to change the default log severity level? I haven't done that yet in #25203 and have been moving forward on the basis that the default level will be info. |
a97de2c to
398d78b
Compare
@jonatack my apologies for the delay. I was busy these few days and am planning to make a PR for it by this weekend.
Yes, I am planning on setting the minimum log level to |
Concept ~0. The example above creates a false view as if leveldb's thread has name "leveldb:debug". |
I agree, this makes parsing more of a hassle. Maybe we can log something like Edit: alternatively, log the thread id instead, but this may be platform specific hassle. |
398d78b to
3a171f7
Compare
|
Code review ACK 3a171f7 |
hebasto
left a comment
There was a problem hiding this comment.
ACK 3a171f7
PR description seems messed about master/PR:
On master:
2022-06-02T14:30:38Z [unknown] [leveldb:debug] Generated table #281@0: 1862 keys, 138303 bytesOn this PR:
2022-05-31T17:16:16Z [leveldb:debug] Generated table #268@1: 27047 keys, 2150932 bytes
and should be updated before merging.
3a171f7 logging: fix logging empty threadname (klementtan) Pull request description: Currently, `leveldb` background thread does not have a thread name and as a result, an empty thread name is logged. This PR fixes this by logging thread name as `"unknown"` if the thread name is empty On master: ```txt 2022-06-02T14:30:38Z [] [leveldb:debug] Generated table #281@0: 1862 keys, 138303 bytes ``` On this PR: ```txt 2022-06-02T14:30:38Z [unknown] [leveldb:debug] Generated table #281@0: 1862 keys, 138303 bytes ``` ACKs for top commit: laanwj: Code review ACK 3a171f7 hebasto: ACK 3a171f7 Tree-SHA512: 0af0fa5c4ddd3640c6dab9595fe9d97f74d0e0f4b41287a6630cf8ac5a21240250e0659ec4ac5a561e888d522f5304bf627104de2aba0fd0a86c1222de0897c2
Currently,
leveldbbackground thread does not have a thread name and as a result, an empty thread name is logged.This PR fixes this by logging thread name as
"unknown"if the thread name is emptyOn master:
On this PR: