conveyal / osm-lib

A library for opening, updating and manipulating OSM files of any size.
BSD 2-Clause "Simplified" License
39 stars 13 forks source link

As a library, osm-lib should not depend on a logging implementation #8

Open abyrd opened 9 years ago

abyrd commented 9 years ago

osm-lib declares a dependency on Logback, which is an implementation of the slf4j logging API. This causes some weirdness when using osm-lib in other projects. According to the documentation of slf4j:

"Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways."

Therefore osm-lib should only depend on slf4j-api.jar, which supplies the API without an implementation, and will default to a no-op implementation.

abyrd commented 9 years ago

This change has been made. The challenge now is that this disables all logging while working with the library on its own. I suppose we need to include a logger dependency for test scope only, and Vanilla Extract should be an external repository.