Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-347

Inconsistent use of singleton pattern in Binder classes

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.7.14
    • 1.7.x
    • Core API
    • None

    Description

      Can somebody please explain why StaticMarkerBinder and StaticMDCBinder implement the singleton pattern using a public field, whereas StaticLoggerBinder has a private field and a public getter method?

      I'm working on making a Clojure logging framework compatible with SLF4J, and this reliance of StaticMarkerBinder and StaticMDCBinder on public fields rather than getters is causing problems because Clojure, being functional, does not allow us to expose public fields in classes - only methods.

      It looks like StaticMarkerBinder.SINGLETON is only referenced here, and StaticMDCBinder.SINGLETON is only referenced here. Is there a technical reason why these access the fields directly, or is it just the result of an early decision being frozen into the API?

      Many thanks

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            rufoa Rufus Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: