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)