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

fix: log the function name, the file name, and the line number with macros #245

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

YuanYuYuan
Copy link
Contributor

We should log the information of function names, file names, and line numbers with macros rather than doing so inside a function.

Taking export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})" as an example,

  • Current
[ERROR 1721033624.485865217] [Logging Test]: Message (log_named() at /workspace/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/logging.cpp:50)
  • After fixed
[ERROR 1721034005.478704138] [Logging Test]: Message (rmw_init() at /workspace/src/rmw_zenoh/rmw_zenoh_cpp/src/rmw_init.cpp:95)

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@Yadunund Yadunund merged commit de50434 into ros2:rolling Jul 16, 2024
7 of 8 checks passed
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.

2 participants