-
Notifications
You must be signed in to change notification settings - Fork 38
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
Start using spdlog in the repo #225
Conversation
src/TextLogging/src/Logger.cpp
Outdated
|
||
TextLogging::Logger* const log() | ||
{ | ||
auto logger = spdlog::get("console"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it make sense to use a blf-specific name for this, especially given that we modify it (set level, set pattern) so it it may be better to avoid conflicts with other libraries that already may use spdlog "console"?
add_bipedal_locomotion_library( | ||
NAME TextLogging | ||
PUBLIC_HEADERS include/BipedalLocomotion/TextLogging/Logger.h | ||
SOURCES src/Logger.cpp | ||
PUBLIC_LINK_LIBRARIES spdlog::spdlog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Why the names Textlogging
and a Logger
? I believe if we are going to use this only for debug prints then Logger
is too generic for a name, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm terrible with the names 😃 . Do you have any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that, I've seen these names, I am not able to think of others quickly ;D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok.
Windows is failing with
|
Can you update the superbuild to document and install in CI spdlog? Even in the usual base dependencies is fine. Otherwise I can do it myself. |
sure |
Let me know if we can merge it or we should update the superbuild before |
If we can update the superbuild before it would avoid a bit of red sadness in superbuild CI. : ) |
0.6.2 released with spdlog: https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/tag/v0.6.2 . |
Furthermore, given that we use |
PR opened robotology/robotology-superbuild#645 |
598c79a
to
a3038a0
Compare
same error in windows-debug
but now |
Sorry, the problem is described and fixed in robotology/robotology-superbuild-dependencies-vcpkg#43 . |
a3038a0
to
0f0e37e
Compare
Waiting the approval before merging |
Friendly Ping @S-Dafarra and @prashanthr05 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me
Not a big deal, but for @traversaro there were still requested changes. I guess they were resolved right? |
Yes! |
Sorry, I had not noticed this. I had taken a look but forgot to approve. |
This pr should be seen as a point where we can discuss. Then if we found a common agreement we may think to merge it.
In this PR I added
spdlog
. It is a nice log that can be used to print stuff in the terminal.The dependency can be installed with
apt
vcpkg
andbrew
.This is the output of the
TimeVaryingDCMTest
with the code implemented in this PR.We can further customize the output: https://github.com/gabime/spdlog/wiki/3.-Custom-formatting.
It's also possible to automatically print the name of the function, name of the file and line. However, we should define some macros.
The nice thing is that it can be used in a multithread application https://cran.r-project.org/web/packages/RcppSpdlog/vignettes/introduction.html
cc @traversaro @prashanthr05 @S-Dafarra