Skip to content

huntto/SimpleLogger

Repository files navigation

SimpleLogger

A very simple logger for Android.

How to use

  1. Add dependencies for your Android module:
dependencies {
    //
    implementation 'com.ihuntto:log-annotation:1.0.3'
    annotationProcessor 'com.ihuntto:log-compiler:1.0.5'
}
  1. Add @SimpleLog on the class that you want to logcat a simple message when call the method:
@SimpleLog
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

you will get a logcat like this:

2019-05-01 14:30:59.038 7466-7466/? D/MainActivity: <init>()
2019-05-01 14:30:59.045 7466-7466/? D/MainActivity: onCreate(savedInstanceState = null)

References

[1] Android Annotation Processing Tutorial

[2] Javac黑客指南

About

A very simple logger for Android

Resources

Stars

Watchers

Forks

Packages

No packages published