Merge remote-tracking branch 'origin/topic/awelzel/4562-post-proc-lookup-failure'

* origin/topic/awelzel/4562-post-proc-lookup-failure:
  btest/logging: Fly-by cleanup
  logging/Ascii: Fix abort() for non-existing postrotation functions

(cherry picked from commit f4357485d2)
This commit is contained in:
Arne Welzel 2025-06-16 14:58:12 +02:00 committed by Tim Wojtulewicz
parent 356685d82d
commit 59a1c74ac5
7 changed files with 66 additions and 19 deletions

View file

@ -744,10 +744,9 @@ void Ascii::RotateLeftoverLogs() {
auto ppf = default_ppf;
if ( ! ll.post_proc_func.empty() ) {
auto func = id::find_func(ll.post_proc_func.data());
if ( func )
ppf = std::move(func);
const auto& id = id::find(ll.post_proc_func.data());
if ( id && id->GetVal() && same_type(id->GetVal()->GetType(), default_ppf->GetType()) )
ppf = id->GetVal()->AsFuncVal()->AsFuncPtr();
else
reporter->Warning(
"Could not postprocess log '%s' with intended "