Giter Club home page Giter Club logo

easylog's Introduction

EasyLog

EasyLog is android.util.Log wrapper making logging even easier.

Basic Usage

Usage of EasyLog is simple. First you have to configure it. Best place is Application.onCreate() method.

    @Override
    public void onCreate() {
        super.onCreate();
        EasyLog.init(this, BuildConfig.DEBUG, "SampleApp");
    }

EasyLog has couple of static methods:

    EasyLog.v("Hello from MainActivity");

    List args = Arrays.asList("one", "two");

    EasyLog.d("Called with %d arguments", args.size());
    EasyLog.d("Arguments are %s", args);
    EasyLog.e("Error occurred: %s", new Exception());

Output of those sample method is:

01-29 15:56:59.040 32228-32228/eu.inloop.easylogsample V/SampleApp: main                          eu.inloop.easylogsample.MainActivity.onCreate(): Hello from MainActivity
01-29 15:56:59.040 32228-32228/eu.inloop.easylogsample D/SampleApp: main                          eu.inloop.easylogsample.MainActivity.onCreate(): Called with 2 arguments
01-29 15:56:59.040 32228-32228/eu.inloop.easylogsample D/SampleApp: main                          eu.inloop.easylogsample.MainActivity.onCreate(): Arguments are [one, two]
01-29 15:56:59.040 32228-32228/eu.inloop.easylogsample E/SampleApp: main                          eu.inloop.easylogsample.MainActivity.onCreate(): Error occurred: null
                                                                    java.lang.Exception
                                                                        at eu.inloop.easylogsample.MainActivity.onCreate(MainActivity.java:24)
                                                                        at android.app.Activity.performCreate(Activity.java:6237)
                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                        at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Arguments

Basically it uses the same format as java.util.Formatter.

Download

Easylog is published in JCenter repo. So you can simply include it in your project by following line of code in build.gradle.

compile 'eu.inloop:easylog:0.6.+'

Credits

Code is inspired by class com.scvngr.levelup.core.util.LogManager from https://github.com/TheLevelUp/levelup-sdk-android license under Apache 2.0 License.

easylog's People

Contributors

martinadamek avatar peterbartos avatar thubalek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.