WorldWindJava icon indicating copy to clipboard operation
WorldWindJava copied to clipboard

Consider using SLF4J.

Open wcmatthysen opened this issue 9 years ago • 4 comments

I am currently using WorldWind as part of a larger system. One of the issues that I came across was that WorldWind uses Java's built-in logging framework. This prevents me from consolidating the logs as our system uses a different logging framework. Wouldn't it be better if WorldWind used SLF4J for logging so that we could decide what logging implementation to use at runtime?

wcmatthysen avatar Oct 04 '16 14:10 wcmatthysen

You could use the jul-to-slf4j bridge.

pron avatar Oct 05 '16 12:10 pron

Yes. Thanks, I am using that at the moment. It is a bit of a hack though.

wcmatthysen avatar Oct 05 '16 13:10 wcmatthysen

SLF4J is great for logging and I've used it in several other projects, and you are right, it seems like it would make a great fit within WorldWind. However, there are two drawbacks.

  1. World Wind has a history of limiting external dependencies (with exception of the JOGL libraries) in order to simplify SDK utilization for some of our core users (not everyone's development environment is Maven friendly). JUL is convienent in that it doesn't require anything additional.
  2. Need to maintain backwards compatibility. Yes we could just pipe SLF4J right back into jul but that adds some complexity to the existing SDK.

I'm sorry that World Wind's utilization of the standard Java logging utility creates two different logs for your application but the jul-to-sl4j bridge looks like a good work around. I'll keep this open and see if there is any additional interest.

zglueck avatar Oct 05 '16 18:10 zglueck

We use WorldWind in a similar way, and we're also using the jul-to-slf4j bridge.

It would be interesting to have SLF4J in WorldWind though!

bjarven avatar Oct 07 '16 06:10 bjarven