[slf4j-dev] [JIRA] (SLF4J-401) Upgrade SLF4J binding mechanism to use java.util.ServiceLoader

QOS.CH (JIRA) noreply-jira at qos.ch
Fri Mar 24 22:16:00 CET 2017


    [ https://jira.qos.ch/browse/SLF4J-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18591#comment-18591 ] 

Ceki Gülcü commented on SLF4J-401:
----------------------------------

Thanks for the offer. BTW, the modularizaton part is [done|https://github.com/qos-ch/slf4j/tree/1_8_0-SNAPSHOT]. 

To be more precise, I am trying to have a single jar file which will be seen as modular on Java 9 and as a regular jar in older JVMs, with module-info.class ignored.

Quoting from [The State of the Module System|http://openjdk.java.net/projects/jigsaw/spec/sotms/]:
{quote}
  A modular JAR file can be used as a module, in which case its
  module-info.class file is taken to contain the module’s
  declaration. It can, alternatively, be placed on the ordinary class
  path, in which case its module-info.class file is ignored. Modular JAR
  files allow the maintainer of a library to ship a single artifact that
  works both as a module, on Java SE 9 and later, and as a regular JAR
  file on the class path, on all releases. We expect that
  implementations of Java SE 9 which include a jar tool will enhance
  that tool to make it easy to create modular JAR files.
{quote}
This is the problem I am struggling with. 

> Upgrade SLF4J binding mechanism to use java.util.ServiceLoader
> --------------------------------------------------------------
>
>                 Key: SLF4J-401
>                 URL: https://jira.qos.ch/browse/SLF4J-401
>             Project: SLF4J
>          Issue Type: Sub-task
>          Components: Core API
>            Reporter: Ceki Gülcü
>            Assignee: Ceki Gülcü
>            Priority: Blocker
>              Labels: binding
>             Fix For: 1.8.0
>
>
> The {{org.slf4j.impl.StaticXYZBinder}} approach has been surprisingly successful for such a crude mechanism. However, with the advent of Java 9/jigsaw/modularisation we need a more standard approach. {{java.util.ServiceLoader}} introduced in Java 6 seems to fit the bill.



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the slf4j-dev mailing list