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

Class Loader prints DEBUG level log then throws #119

Open
IanTheEngineer opened this issue Jul 16, 2018 · 1 comment
Open

Class Loader prints DEBUG level log then throws #119

IanTheEngineer opened this issue Jul 16, 2018 · 1 comment

Comments

@IanTheEngineer
Copy link

Right I'm debugging an issue in ROS Kinetic where pluginlib is failing to find/load my plugins. If it turns out to be an issue that could affect other users, I'll create an Issue/PR for it.

In the mean time, I've encountered a more direct issue: I am not seeing much output when the pluginlib fails to load a class. In particular, after setting ROS_LOGGER level to DEBUG, I ran into this DEBUG output which seems like it should be a ROS_ERROR_NAMED as it throws:

template<class T>
void ClassLoader<T>::loadLibraryForClass(const std::string & lookup_name)
/***************************************************************************/
{
  ClassMapIterator it = classes_available_.find(lookup_name);
  if (it == classes_available_.end()) {
    ROS_DEBUG_NAMED("pluginlib.ClassLoader", "Class %s has no mapping in classes_available_.",
      lookup_name.c_str());
    throw pluginlib::LibraryLoadException(getErrorStringForUnknownClass(lookup_name));
}

It is possible that the pluginlib::LibraryLoadException should be printing a more user-friendly error, but I am not seeing any output in my logfile after the DEBUG print, so that might actually be the core of the issue.

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Sep 14, 2018

thanks @IanTheEngineer for reporting (and the patience).
It looks like pluginlib is printing only debug messages when throwing.
There isn't much context about why these are logged with a DEBUG severity rather than ERROR in the commit introducing them. I would expect that it is for users to be able to catch such exception without having important severity in their logs.
Edit: that's what pluginlib_tutorials do for example: https://github.com/ros/common_tutorials/blob/indigo-devel/pluginlib_tutorials/src/polygon_loader.cpp

It is possible that the pluginlib::LibraryLoadException should be printing a more user-friendly error, but I am not seeing any output in my logfile after the DEBUG print, so that might actually be the core of the issue.

Do you mean that a more descriptive message printed to debug would be satisfactory ? or that you would like all messages logges when trhowing to be logged with a higher severity?

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

No branches or pull requests

2 participants