rdixits / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

JSMPP without Log4J/SLF4J dependency #151

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Can we have a version of jsmpp JAR file without the Log4J or Slf4J 
dependencies. Just a clean JSMPP that only does what it's supposed to do 
without any logging support.

Attached here is a quick hack to replace all references of the Slf4J library 
with a pretentious set of classes that pretends to log but simply ignores all 
logging input.

pretentious-slf4j.rar - The source code for Logger and LoggerFactory in 
org.slf4j package.
jsmpp-2.1.0-no-logging.jar - Rebuild (Java 1.5) of jsmpp-2.1.0.jar with above 
pretentious logging classes added. This jar is *completely independent* of the 
Log4J and SLF4J libraries, so you don't need them in the classpath.

But ideally, you should create a single dedicated logging class 
(org.jsmpp.Logger or org.jsmpp.extra.Logger) to interface with the Slf4J logger 
API, and all other classes should use this dedicated logging class. The idea 
is, it will be very easy to replace this dedicated logging class with a dummy 
logging class to create a no-logging version of JSMPP.

You don't even have to edit all the source code. Just create org.jsmpp.Logger 
and org.jsmpp.LoggerFactory, then change all the imports. Simple :)

Original issue reported on code.google.com by send2a...@gmail.com on 20 Sep 2013 at 9:41

Attachments: