Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Java/Android AOP library that logs method arguments, return values, and execution time using ASM bytecode manipulation.
Koala is a Java/Android AOP library that logs method arguments, return values, and execution time by modifying bytecode with ASM at compile time.
Koala is an open-source Java/Android library created by lijiankun24 that prints a method's class name, method signature, arguments, return result, and execution time to Logcat when that method is annotated with @KoalaLog. It operates as a Gradle plugin plus runtime library, and implements AOP through ASM bytecode rewriting rather than AspectJ. The project is released under the Apache License 2.0 and had 145 stars at the time of this description.
@KoalaLog to any Java method to get structured Logcat output; no manual logging code required.com.lijiankun24.koala-plugin in the module's build.gradle and adding the com.lijiankun24:koala dependency.-keep class com.lijiankun24.koala.**) so the library survives release builds with minification enabled.getName example that prints arguments and result.@KoalaLog and the next invocation will print the class name, method signature, arguments, return value, and elapsed time in Logcat.Koala is installed in three steps. First, add the Gradle plugin to the project's build classpath using gradle.plugin.com.lijiankun24:buildSrc:1.1.1. Second, apply the plugin with apply plugin: "com.lijiankun24.koala-plugin" in the module and add the runtime dependency com.lijiankun24:koala. Finally, annotate any Java method with @KoalaLog; at build time ASM rewrites the method's bytecode to insert logging around the original implementation.
Yes, Koala is open source and released under the Apache License 2.0, so it is free to use, modify, and redistribute.
Both log method arguments, results, and execution time, but Koala implements AOP via ASM bytecode modification while Hugo uses AspectJ. Koala is distributed as a Gradle plugin plus runtime dependency, which may be simpler to integrate in Android projects.
The README only shows Java usage with the @KoalaLog annotation on Java methods. There is no explicit statement about Kotlin support.
Add the plugin to the buildscript dependencies, apply the plugin, add the com.lijiankun24:koala dependency, and then annotate methods with @KoalaLog. ProGuard configuration is also provided.
