Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA] Investigate C++ Logging libraries #295

Closed
jrhemstad opened this issue Feb 14, 2020 · 7 comments
Closed

[FEA] Investigate C++ Logging libraries #295

jrhemstad opened this issue Feb 14, 2020 · 7 comments
Assignees
Labels
feature request New feature or request

Comments

@jrhemstad
Copy link
Contributor

Is your feature request related to a problem? Please describe.

It would be nice to use a dedicated logging library for RMM logging.

Describe the solution you'd like

Investigate C++ logging library solutions.

@jrhemstad jrhemstad added the feature request New feature or request label Feb 14, 2020
@jrhemstad jrhemstad self-assigned this Feb 14, 2020
@harrism
Copy link
Member

harrism commented Feb 16, 2020

Some links:

Some analysis:
https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/

g3log: https://github.com/KjellKod/g3log
spdlog: https://github.com/gabime/spdlog
glog: https://github.com/google/glog

I think that we should discuss requirements / desires. Speed is important, and also simplicity, and very important is impact on installation of RMM (I think we would like RMM to become header-only). I think a logger that is header-only and mature, so we could vendor it directly into RMM rather than submoduling it.

I haven't thought about whether overall latency is important, as discussed in the first link above.

@jrhemstad
Copy link
Contributor Author

I think a logger that is header-only and mature, so we could vendor it directly into RMM rather than submoduling it.

Agreed. I generated table to summarize these things

Header only? C++ Version GitHub stars (maturity) License Notes
spdlog Yes (static lib reccomended) C++11 7800 MIT More features than we really need.
g3log No C++14 550 Public Domain
glog No ? 3600
loguru Yes C++11 831 Public Domain
plog Yes C++03 819 Mozilla Public 2.0 Very simple

Some requirements I've been thinking about:

  • Simple
  • Header-only
  • Output to CSV
  • Info we care about logging:
    • Allloc/Free + Size
    • Timestamp
    • Pool state (total free, in used)
    • Call stack?

@harrism
Copy link
Member

harrism commented Feb 17, 2020

Info: also # active allocations and allocation strategy-specific data like fragmentation metrics could come in handy.

@jakirkham
Copy link
Member

I believe Glog is BSD-3-Clause. It included some third-party BSD-3-Clause code as well.

As to minimum C++ version it may C++03 or C++98, but wasn't sure either. Raised issue ( google/glog#527 ) to see if they could provide some guidance 🙂

@teju85
Copy link
Member

teju85 commented Feb 18, 2020

I've seen some logging implementations need access to argc and argv for initializing the underlying "state" of the logger. IMO, that's particularly not great for libraries, and also especially when trying to access those libraries via python layer. Probably, this would also be something that we'd need to consider.

@jrhemstad
Copy link
Contributor Author

I've seen some logging implementations need access to argc and argv for initializing the underlying "state" of the logger. IMO, that's particularly not great for libraries, and also especially when trying to access those libraries via python layer. Probably, this would also be something that we'd need to consider.

Yikes, yeah, that would definitely disqualify any logging library that required something like this.

@harrism
Copy link
Member

harrism commented Mar 12, 2020

spdlog chosen and implemented in #297. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants