Skip to content

Comments

[kbl2vec] Logger aware ConverterRegistry#377

Open
beckerjohannes wants to merge 1 commit intodevelopfrom
logger-for-converters
Open

[kbl2vec] Logger aware ConverterRegistry#377
beckerjohannes wants to merge 1 commit intodevelopfrom
logger-for-converters

Conversation

@beckerjohannes
Copy link
Contributor

Pull Request

Changes

  • Code
  • Documentation
  • Other:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request makes the ConverterRegistry logger-aware by adding a Logger parameter to its constructor. The change enables better logging control and dependency injection by accepting a logger instance instead of using a hardcoded static logger reference.

  • Added Logger parameter to ConverterRegistry constructor
  • Updated TransformationContextImpl to accept and use injected Logger
  • Modified all instantiations to pass the transform logger explicitly

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ConverterRegistry.java Added Logger parameter to constructor and stored as field
TransformationContextImpl.java Modified constructor to accept Logger parameter instead of using static reference
ConversionOrchestrator.java Updated to pass transform logger to dependencies
TestConversionOrchestrator.java Updated test setup to pass transform logger
DeterministicXmlIdGeneratorTest.java Updated test setup to pass transform logger and simplified imports

Comment on lines +41 to +44
private final Logger transformLogger;

public ConverterRegistry(final ConversionProperties conversionProperties) {
public ConverterRegistry(final Logger transformLogger, final ConversionProperties conversionProperties) {
this.transformLogger = transformLogger;
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

The Logger field is added but never used within the ConverterRegistry class. If logging functionality is intended, consider adding appropriate log statements or removing the unused field to avoid confusion.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

private final StringToColorConverter stringToColorConverter;
private final StringToWireTypeConverter stringToWireTypeConverter;
private final StringToMaterialConverter stringToMaterialConverter;
private final Logger transformLogger;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand why the ConverterRegistry needs a logger. Will there be dedicated logging for the converter in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See my comments in the Geometry PR. I should have read the PR completely first, but I was acting to fast. Having seen the complete solution, I think this PR is unnecessary (at least for the time being). I will leave it here, maybe there is a need for logging by the converters in the future.

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