You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Andreas Sewe (JIRA)" <ji...@apache.org> on 2019/06/26 08:25:00 UTC
[jira] [Created] (LOG4J2-2643) Logger.traceExit should have
Supplier overloads
Andreas Sewe created LOG4J2-2643:
------------------------------------
Summary: Logger.traceExit should have Supplier overloads
Key: LOG4J2-2643
URL: https://issues.apache.org/jira/browse/LOG4J2-2643
Project: Log4j 2
Issue Type: Improvement
Components: API
Affects Versions: 2.11.2
Reporter: Andreas Sewe
In LOG4J2-1255, [~ggregory] stated that he doesn't have a use case for {{traceExit(R, String, Supplier...) : R}}.
Here is one:
* {{R.toString()}} only produces inadequate information (worst case: it defaults to {{Object.toString()}}).
To cope with this, I would like to do the following:
{noformat}
return LOG.traceExit(result, () -> SomeExpensiveToStringHelper.toString(result));
{noformat}
For {{Logger.traceEntry}} I already do it like this for those types {{R}} which have an inadequate {{toString()}} method, but for {{traceExit}} I cannot.
So please add {{traceExit(String, R, Supplier...) : R}} (Note that the first two parameters have changed places since the original discussion, to mirror the existing {{traceExit(String, R) : R}}.)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)