[jboss-jira] [JBoss JIRA] (LOGTOOL-142) Support java.util.function.Supplier as a parameter to logs and bundles

James Perkins (Jira) issues at jboss.org
Tue Sep 24 17:41:00 EDT 2019


    [ https://issues.jboss.org/browse/LOGTOOL-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788699#comment-13788699 ] 

James Perkins commented on LOGTOOL-142:
---------------------------------------

This would have to likely be supported in JBoss Logging as well. Having be logic in generated code could increase the memory footprint quite a bit if suppliers are excessively used. Though it's something to consider so that this won't be blocked by a logging fix.

> Support java.util.function.Supplier as a parameter to logs and bundles
> ----------------------------------------------------------------------
>
>                 Key: LOGTOOL-142
>                 URL: https://issues.jboss.org/browse/LOGTOOL-142
>             Project: Log Tool
>          Issue Type: Enhancement
>    Affects Versions: 2.2.0.Final
>            Reporter: Daniel Siviter
>            Priority: Major
>
> Similar to JDK logging that supports deferred logging using {{java.util.function.Supplier}}, allow for JBoss logging but for each parameter within a log and bundle.
> e.g.
> {code}
> @LogMessage
> @Message("I'm going to log something computationally expensive: %s")
> void expensive(Supplier<String> value);
> {code}
> Which could then be used as:
> {code}
> LogInterface.LOG.expensive(this::toExpensiveFormattedString);
> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list