-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add rcl_logging_rcutils #86
Conversation
Signed-off-by: Shane Loretz <[email protected]>
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 wondering if instead of a new logger here, we instead can make it so that we can configure spdlog to only output to stderr (and not files). spdlog does seem to support custom sinks, so maybe that could work instead? What do you think?
How do you think it should be configured? Environment variable? CMake variable? An environment variable might be useful for not having to recompile binaries. How specific are you thinking? Very specific to the logger like |
Yeah, this was my main motivation. While rcl_logging is in some sense pluggable, in reality it is only reconfigurable at compile-time. It would be much more useful if we could configure it at runtime instead. With that in mind...
I think an environment variable is a good idea.
I'm thinking it should be relatively specific, while not exposing too many internal details. So something like |
Seems reasonable. It seems likely to me that only Another general option might be to add a function to |
I opened #88 to capture the idea of configuring logging sinks by environment variable, and moved the |
This adds an
rcl_logging
implementation using thercutils
logger. This logs to stderr (by default) without touching the file system. This idea is to enable logging on read-only filesystems. The defaultrcl_logging_spdlog
can't be used because it errors if it can't create a directory inROS_HOME
.I thought I needed this for a personal project, but it turns out I need something a little different, so I'm making the PR in its current state. It's lacking testing and tests.