-
Notifications
You must be signed in to change notification settings - Fork 163
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
Log call from rcl_init (i.e. before logging is initialized) #1037
Comments
There's another one here: Line 353 in 4eccc3c
Called from Line 127 in 4eccc3c
EDIT: actually there's several more Not sure what the best solution is. Given that:
so it seems that none of these log messages have ever been shown. So one option would be to just delete those calls. The better option is probably to use the |
So there's a couple of things we could do here (these options are non-exclusive):
If you'd like to take a closer look and open a PR to do some of that, we'd be happy to review. |
Ok I had another look. The major issue of having a log call in
This has the benefit that all debug log calls can remain. The drawback is:
|
Personally, I think that those drawbacks are acceptable for now. It isn't perfect, but it is an improvement over the situation today. |
@jrutgeer your proposal sounds reasonable, logging allocator should be set before. What about having
I think this case applies, probably we can just remove the logging. |
Sounds good to me.
I would be inclined to leave them as they are. They don't harm, and they might be useful if somebody ever needs to make changes to the arguments parsing logic. |
I do not have strong opinion here, just thought that deleting logging never be effective... i am good to leave them as they are. |
Well, they can be enabled, but you need to change the default loglevel and recompile. |
@jrutgeer are you willing to address this? if that is so, we are happy to review 😄 |
@iuhilnehc-ynos @Barry-Xu-2018 any other proposals other than #1037 (comment)? |
Sound good to me.
|
Is that too late to initialize the default level here? for example, during |
That's why I add the second step in #1037 (comment) rcl_init -> RCUTILS_LOGGING_AUTOINIT_WITH_ALLOCATOR -> rcutils_logging_initialize_with_allocator BTW, I don't think we need a new function |
Due to time constraints unfortunately not, but I am willing to think along and provide feedback.
No, see this description: any log call will call However, if it is the intention to configure the loglevel through an environment variable, a code section similar to this should be added in front of this line.
This isn't really necessary, as each log macro does call |
|
Ok I see. My suggestion was to set But your solution might be better: that way |
Keeping the
The |
This is not correct: call to
RCUTILS_LOG_DEBUG_NAMED
during initialization of the context.Logging is not initialized yet, it is initialized after context initialization.
rcl/rcl/src/rcl/init.c
Lines 71 to 73 in 7bb8d4d
RCUTILS_LOG_DEBUG_NAMED
does callRCUTILS_LOGGING_AUTOINIT
but that is not intended at this point, see also #1036.The text was updated successfully, but these errors were encountered: