There is no any steps for java implementation and some java developer want's
to implement this library so here is the steps
implementation 'com.squareup.logcat:logcat:0.1'
Now you can use this library in your any class
Or if we want to print any exception then try below code.
First step
Install AndroidLogcatLogger in Application's onCreate() method
import android.app.Application; import logcat.AndroidLogcatLogger; import logcat.LogPriority; public class ExampleApplication extends Application { @Override public void onCreate() { super.onCreate(); AndroidLogcatLogger.Companion.installOnDebuggableApp(this, LogPriority.VERBOSE); } }
LogcatKt.logcat("MyFirstTag", LogPriority.ERROR, () -> "Add your log here");
LogcatKt.logcat("MyOtherTag", LogPriority.ERROR, () -> ThrowablesKt.asLog(new RuntimeException("Hello world")));
Here is the github link of this library : https://github.com/square/logcat
Best of luck...
No comments:
Post a Comment