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

LogBuilder should not have no-op default methods

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.14.1
    • None
    • None

    Description

      Currently the methods of the interface org.apache.logging.log4j.LogBuilder are all default methods which are no-op.
      In my opinion this is not ideal because these no-op implementations should only exist for the LogBuilder.NOOP, or for any methods which are added in the future which not every logger supports.
      With the current situation it is easy to forget implementing one of the LogBuilder methods.

      If you choose to keep this LogBuilder behaviour, it would be good to at least document this so implementors of the interface are aware of it. Though this would then create confusion for the end-user because the LogBuilder returned by Logger is actually not no-op (which also shows that the LogBuilder methods should not be no-op by default in the first place).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Marcono1234 Marcono1234
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m