Skip to content

Leverage Usage of LogRecords #122

@cuioss

Description

@cuioss

Currently, de.cuioss.tools.logging.CuiLogger only accepts String templates for logging.
For cases with LogRecords this result in structures like:
LOGGER.error(e, ERROR.EXPORT_FAILED::format) or LOGGER.info(INFO.KEY_PREGENERATION_COMPLETED.format(MAX_CACHED_ISSUERS, duration));

Which is verbose and implicitly disables the lazy-initialization

The tasks:
For INFO, WARN, ERROR (Explicitly not for TRACE and DEBUG) add additional variants for LogRecords instead of String-templates

public void info(Throwable throwable, LogRecord template, Object... parameter)
public void info(LogRecord template, template, Object... parameter) 

public void info(Throwable throwable, LogRecord template)
public void info(LogRecord template) 

Add the variants without Object... parameter for the String-based templates as well(optimized code-paths). Do this for ALL log-level

If not already there add JSpecify NonNull at Package-level for the logging as default. Verify the result
Test everything thoroughly

Update the local module usage of LogRecord to use the new method instead of LogRecord#format

If everything is done and verified, add an issue to https://github.com/cuioss/cui-open-rewrite for automatically refactoring to the new Style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions