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

Added LogHandler, this enables the possibility to change the behavior when logging messages with this library. #40

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

urmahp
Copy link
Collaborator

@urmahp urmahp commented Mar 5, 2021

I have renamed the log macros to something more specific to this library, this make the macros less likely to clash with other macros in the project, where this library is used.

I have added a default log handler which is used as default and as long as no other loghandler is enabled.

This makes it less likely that the log macros with have same name as log macros in the application where this library is used.
@fmauch
Copy link
Collaborator

fmauch commented Mar 7, 2021

Quickly skimming over the changes this looks good to me. It might be a good idea to factor out the ROS logger, as well and move it to the driver, but we can do that in a separate build, as well.

@urmahp I guess, this is an alternative to #32?

@urrsk urrsk requested a review from t-schnell March 8, 2021 08:40
@urrsk
Copy link
Member

urrsk commented Mar 8, 2021

@fmauch yes it is an alternative to #32.

  1. The plan is to first implement this in the ISAAC driver
  2. Then we can see when to merge it into the ros driver. (Maybe introduce it in the beta or wait to after release)

@fmauch To not take too much of your time, I will ask @t-schnell to review it. But you are more than welcome.

@fmauch
Copy link
Collaborator

fmauch commented Mar 8, 2021

I've tested it yesterday with a minimal example I have, where I created my own logger. It worked well.

I think, it would be good to also add some documentation on how to include this into your own application.

Also, it might be good to set the default logging mechanism to WARN to reduce the default amount of output.

@urmahp
Copy link
Collaborator Author

urmahp commented Mar 8, 2021

Thanks for the contribution @fmauch, that is a good idea.

I will update the pr today.

include/ur_client_library/log.h Outdated Show resolved Hide resolved
include/ur_client_library/log.h Outdated Show resolved Hide resolved
src/log.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'm holding this back, as the ROS driver needs a patch before merging this. A couple of LOG_XXXX macros have made it into the driver which will result in build failures.

See UniversalRobots/Universal_Robots_ROS_Driver#330

…ge the behavior when logging messages with this library.
@fmauch
Copy link
Collaborator

fmauch commented Mar 10, 2021

I've rebased and cleaned up this branch. As soon as CI runs through, I'll merge in those changes.

@fmauch fmauch merged commit 487f92f into UniversalRobots:master Mar 10, 2021
@fmauch
Copy link
Collaborator

fmauch commented Mar 10, 2021

Thanks @urmahp for this contribution!

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

Successfully merging this pull request may close these issues.

None yet

3 participants