How does slf4j bind to implementation? Does it really do so during compile time?

后端 未结 6 1697
轮回少年
轮回少年 2021-02-13 03:58

In the documentation for slf4j it says that the binding happens during complie time:

\"SLF4J does not rely on any special class loader machinery. In fact, each SLF4J bi

6条回答
  •  执笔经年
    2021-02-13 04:22

    The implementation is not bound at compile-time (it's not a static/early binding) or in other words the implementation it's not known at compile time.

    Actually it's the vice-versa where the implementation is bound at runtime, meaning that the implementation is discovered through dynamic/runtime binding . The Slf4j folks have actually declared how the binding happens in their manual https://www.slf4j.org/manual.html:

    SLF4J allows the end-user to plug in the desired logging framework at deployment time.

提交回复
热议问题