Skip to content

Use slf4p's format-args-plus-exception overloads - #570

Merged
michaelJustin merged 1 commit into
masterfrom
559-log-format-args-with-exception
Oct 14, 2026
Merged

michaelJustin merged 1 commit into
masterfrom
559-log-format-args-with-exception

Conversation

@michaelJustin

Copy link
Copy Markdown
Owner

Closes #559.

Summary

  • The five log calls listed in Parametrized logging for the exception-carrying call sites (rest of #552) #559 now use slf4p's new (AFormat; AArgs: array of const; AException: Exception) overload (Add format-args-plus-exception overloads to ILogger slf4p#97) instead of formatting the message themselves:
    • TdjWebFilterHolder.Stop (2 calls)
    • TdjWebComponentHolder.Stop
    • TdjWebComponentHandler.InvokeService
    • TdjWebComponentContextHandler.DoHandle (an ErrorHandler that raised)
  • The logged text is unchanged. The two ...Stop: calls keep their prefix.
  • Daraja now requires slf4p 1.2.0. The README requirements list and the CHANGELOG (Changed) say so. slf4p master is 1.2.0-SNAPSHOT and already has the overload; slf4p 1.2.0 must be released before Daraja 3.5.0.

Test plan

The changed lines are compiled only with DARAJA_LOGGING, which neither run-fpc.cmd, run-delphi.cmd nor CI defines. I checked them separately:

  • FPC 3.2.2: the four units compile with -dDARAJA_LOGGING against slf4p master.
  • Delphi 2009: Unittests.dpr built with -DDARAJA_LOGGING runs 215/215 OK. The log output shows the new calls, e.g. ERROR TdjWebComponentContextHandler ErrorHandler raised Exception while handling EUnitTestException; falling back to the default error response and WARN TdjWebFilterHolder TdjWebFilterHolder.Stop: error in destroy, each followed by the exception class and message.

🤖 Generated with Claude Code

The five log calls that pass an exception built their message eagerly
(string concatenation or Format) because ILogger had no overload taking
format arguments and an exception. slf4p 1.2.0 adds one (slf4p#97), so
use it; the logged text is unchanged.

Daraja now requires slf4p 1.2.0 (README, CHANGELOG).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@michaelJustin michaelJustin added this to the 3.5.0 milestone Oct 14, 2026
@michaelJustin
michaelJustin merged commit e0ddbd0 into master Oct 14, 2026
3 of 4 checks passed
@michaelJustin
michaelJustin deleted the 559-log-format-args-with-exception branch October 14, 2026 18:51
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.

Parametrized logging for the exception-carrying call sites (rest of #552)

1 participant