Tiny, lightweight, informative and very useful logger for Android. New LogCat adaptation for Android Studio Dolphin | 2021.3.1 Patch 1 and higher You don't need to define TAG. It is automatically generated and include file name, method, line number and of of course the link to the code. Also contains the LongLog class which allows you to print a long messages into the LogCat without limiting the standard output length to less than ~ 4075.
Download the latest release v2.1.1
Just try the Java or Kotlin Demo apps
You can see more examples in demo applications.
Log.v("Verbose");
Log.d("Debug");
Log.i("Info");
Log.e("Error");
try{
int i = 10/0;
} catch (Exception e) {
Log.e("Some exception", e);
}
Possibility to outline the log strings (by default). You can also turn off this, just call Log.setLogOutlined(false);
You'll get in your LogCat the lines like below. Clicking on the tag brings you to log into the source code of the class which was caused by the logger:
Easy objects formatting
Sometimes there is a need to display a log of big data. Usual a loggers truncate it. Use LongLog. It will output all data page by page without loss.
Simple add to your Application class.
ComponentLog.enableComponentsChangesLogging(this);
You will receive information about an activity lifecycle calls
and a changes of the fragments stack
Allows use all log information in a custom interceptor. See the LogToFileInterceptor which save a log messages to file and you can share the zipped log with help of any external applications, for example by email, google drive and etc.
public class YourInterceptor extends LogInterceptor {
@Override
public void log(Level level, String tag, String msg, @Nullable Throwable th) {
// Use this data for save the log to file, send to cloud or etc.
}
}
using:
Log.addInterceptor(YourInterceptorImplementation)
It is also possible to choose ready-made LogToFileInterceptor and LogToMemoryCacheInterceptor
Allows to use the simple library snippet to display the application log, record, share, filter
val logFragment = LogFragment()
supportFragmentManager.beginTransaction().add(R.id.frameContent, logFragment).commit()
Simple usage - Init at start logging
LogToFileInterceptor.init(context)
Prepare and run zipper
logZipper = LogZipper(LogToFileInterceptor.getSharedInstance(context))
logZipper.shareZip(activity)
Android tao log lib is available for direct download (unfortunately Bintray has been deprecated ).
Please ensure that you are using the latest releases
Put downloaded taolog-*.aar file in to the 'lib' directory in your app module and add Gradle dependency:
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation files('libs/taolog-*.aar')
- New LogCat adaptation for Android Studio Dolphin | 2021.3.1 Patch 1 and higher
- Added listW, listE, listV, listE methods
- Refactoring
- Migration to Kotlin
- Refactoring
- Fixed LogToFileInterceptor
- Added LogToMemoryCacheInterceptor
- Added LogFragment
- Added Log Zipper / Sharing
- Fixed throwable doubles info
- removed annotations for backward compatibility
- added ToFileInterceptor
- Removed @ToLog annotation.
- Added log interceptor.
- Activity lifecile and fragments stack logging moved to ComponentLog class.
- Added LongLog for possibility print to LogCat very long messages.
- Activity lifecile and fragments stack logging updates
- added Kotlin classes support;
- added possibility to align to right new lines in log for AndroidStudio 3.1;
- combined @ToLog results in/out to one output method.
- added support @ToLog annotation;
- added outline log possibility;