kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Investigate the possiblity and method to replace GLOG with spdlog

Open PragmaTwice opened this issue 1 year ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Motivation

spdlog (https://github.com/gabime/spdlog) is a modern logging library based on fmt library (or std::format).

It's better to use spdlog instead of glog because we extensively utilize the fmt library.

Note: we need to specify SPDLOG_FMT_EXTERNAL since we need to keep there's only one fmt library in our deps.

Solution

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

PragmaTwice avatar Apr 22 '24 10:04 PragmaTwice

@PragmaTwice Good idea. However, we use this function from the glog library https://github.com/apache/kvrocks/blob/unstable/src/cli/signal_util.h#L54.

I was looking for a way to get rid of it because in the glog-0.7.0 it's no more public.

N.B. I tried to use the libunwind but failed to add it to the project. However, it's a different story :)

YaroslavStepanchuk avatar Apr 22 '24 11:04 YaroslavStepanchuk

hello, I'm a beginer, Can I choose this issue ?

133tosakarin avatar Apr 22 '24 12:04 133tosakarin

@133tosakarin Perhaps you can try #2266 first.

git-hulk avatar Apr 23 '24 05:04 git-hulk

@git-hulk @PragmaTwice Could you assign this one to me?

BTW, is there any expected performance improvement after replacing GLOG with spdlog?

letian-jiang avatar Jun 01 '24 05:06 letian-jiang

BTW, is there any expected performance improvement after replacing GLOG with spdlog?

I think it's good if there's no noticeable performance degradation.

PragmaTwice avatar Jun 01 '24 06:06 PragmaTwice