Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2643

Logger.traceExit should have Supplier overloads

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.11.2
    • Fix Version/s: None
    • Component/s: API
    • Labels:
      None

      Description

      In LOG4J2-1255, Gary Gregory 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:

      return LOG.traceExit(result, () -> SomeExpensiveToStringHelper.toString(result));
      

      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.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              asewe Andreas Sewe
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: