-
Notifications
You must be signed in to change notification settings - Fork 30
feat: use algorithms logger service in IrtCherenkovParticleID #1839
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
base: main
Are you sure you want to change the base?
Conversation
I've looked into this yesterday, we could pass a |
I have this working locally with e.g.: - void Print(std::shared_ptr<spdlog::logger> m_log,
- spdlog::level::level_enum lvl = spdlog::level::debug) {
- m_log->log(lvl, "{:=^60}", " MergeParticleIDConfig Settings ");
- auto print_param = [&m_log, &lvl](auto name, auto val) {
- m_log->log(lvl, " {:>20} = {:<}", name, val);
+ template<algorithms::LogLevel lvl = algorithms::LogLevel::kDebug>
+ constexpr void Print(const algorithms::LoggerMixin* log) {
+ log->report_fmt<lvl>("{:=^60}", " MergeParticleIDConfig Settings ");
+ auto print_param = [&log](auto name, auto val) {
+ log->report_fmt<lvl>(" {:>20} = {:<}", name, val);
};
print_param("mergeMode", mergeMode);
- m_log->log(lvl, "{:=^60}", "");
+ log->report_fmt<lvl>("{:=^60}", "");
} All the log levels are available at compile time, never set based on runtime. We upgrade to template arg, then pass |
"working" |
This compiles now with eic/algorithms#22. Suggestions for better names for |
49a575d
to
2a7bf7f
Compare
for more information, see https://pre-commit.ci
66e4a11
to
f0e3ea2
Compare
Capybara summary for PR 1839
|
✅ Images for pipeline 117102 are now available. View here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few things which move in a wrong way here, I would really prefer if Tools was moving towards becoming a namespace, instead of full fledged class (dissolving it would be a plus, but certainly outside of scope). Same goes for use of Config class, which now has to know about algorithm class.
I'm on the same page: I already have a branch locally that does some of that (doesn't get rid of |
f12a566
to
92ff5ab
Compare
@veprbl Tools is namespace now; some stuff taken out (maybe we can push it a level up into a |
Briefly, what does this PR introduce?
This PR ensures that IrtCherenkovParticleID uses the algorithms logger, so it does not have to be passed by the factory.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.