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

feat: add a logging interface, dependency injectable loggers #233

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

mojomex
Copy link
Collaborator

@mojomex mojomex commented Nov 22, 2024

PR Type

  • Improvement

Related Links

Description

This PR adds an abstract nebula::drivers::loggers::Logger interface that provides the following functions:

  • debug(msg)
  • info(msg)
  • warn(msg)
  • error(msg)
  • child(name) -> std::shared_ptr<Logger> which creates a child logger (names are concatenated with .)

A NEBULA_LOG_STREAM(log_func, stream_args) macro is also provided for convenience.

There are currently two implementations of this interface:

  • nebula::drivers::loggers::ConsoleLogger (in nebula_common)
  • nebula::drivers::loggers::RclcppLogger (in nebula_ros)

The motivation of this PR is to, in the long run, remove the dependency on RCLCPP from all Nebula packages except nebula_ros.

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.10%. Comparing base (47efeed) to head (4136ccb).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #233   +/-   ##
=======================================
  Coverage   26.10%   26.10%           
=======================================
  Files         100      100           
  Lines        9218     9218           
  Branches     2215     2215           
=======================================
  Hits         2406     2406           
  Misses       6423     6423           
  Partials      389      389           
Flag Coverage Δ
differential 26.10% <ø> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@drwnz drwnz left a comment

Choose a reason for hiding this comment

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

LGTM!

@mojomex mojomex merged commit 77b4c6c into main Nov 25, 2024
13 checks passed
@mojomex mojomex deleted the feat/di-logger-classes branch November 25, 2024 09:52
mojomex added a commit that referenced this pull request Nov 26, 2024
Signed-off-by: Max SCHMELLER <[email protected]>
mojomex added a commit that referenced this pull request Nov 26, 2024
Signed-off-by: Max SCHMELLER <[email protected]>
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