I have a sampleApplication which has only one class and class Name is Test
Following are the scenarios:
Case1:
public class Test {
public void callme()
{
System.out.println("Inside Call me Method");
}
}
Case2:
public class Test {
private static final Logger log = LoggerFactory.getLogger(Test.class);
public void callme()
{
log.info("Inside Call me Mthod using logback");
}
}
The use case is as follows:
I have to bundle this Test.class into a jar and use it android project..In case1 when i bundle the test class in jar and use it in android project...Inside the android application logs i am able to see the sysout statements.
But as per the practices sysouts must be replace with some logging framework.
So i Have tried scenario2, I have implemented logback along with the Test Class,and bundled the jar and have used in android project. The application failed and threw an exception as the dependency slf4j,logback classic and logback core are missing in android,i tried to add them in android build.gradle file..it still didnt help....
Question:
I have implemented all the functional code and wasnt able to achieve logging.Is there any way the logging can be achieved
Note:I knew in android we use Android.util.Log...but that is in android project..but my jar is external jar developed in java which doesnt have access to Android.util.Log..Hope the question is clear..
Is there any way to achieve the logging ...Or should i consider building an android library instead of plain jar and plug it in android project..If so what is the process? Sorry if the framing of question is not clear