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

Logger.traceExit should have Supplier overloads

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.11.2
    • None
    • API
    • None

    Description

      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:

      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

            Unassigned Unassigned
            asewe Andreas Sewe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: