Android Utility : Android Best Log Utility for Singed App & Debug App

December 19, 2018 , , 0 Comments

Google Android Apps



Here, Best Practices for android Application in Log methods, Directly Copy Paste this Class to Use Any Application,

As per your Requirement Easily Changes to All methods & Name,

When Application is Signed than No Logged Display in Console,other (In Debug Mode) Log Can see in Console mode,

public class 
public class LogM {

    public static void i(String message) {
        if (BuildConfig.DEBUG) Log.i("log_tag", message);    }

    public static void v(String message) {
        if (BuildConfig.DEBUG) Log.v("log_tag", message);    }

    public static void d(String message) {
        if (BuildConfig.DEBUG) Log.d("log_tag", message);    }

    public static void w(String message) {
        if (BuildConfig.DEBUG) Log.w("log_tag", message);    }

    public static void e(String message) {
        if (BuildConfig.DEBUG) Log.e("log_tag", message);    }

    public static void i(String key, String message) {
        if (BuildConfig.DEBUG) Log.i(TextUtils.isEmpty(key) ? "log_tag" : key, message);
    }

    public static void v(String key, String message) {
        if (BuildConfig.DEBUG) Log.v(TextUtils.isEmpty(key) ? "log_tag" : key, message);
    }

    public static void d(String key, String message) {
        if (BuildConfig.DEBUG) Log.i(TextUtils.isEmpty(key) ? "log_tag" : key, message);    }

    public static void w(String key, String message) {
        if (BuildConfig.DEBUG) Log.w(TextUtils.isEmpty(key) ? "log_tag" : key, message);    }

    public static void e(String key, String message) {
        if (BuildConfig.DEBUG) Log.e(TextUtils.isEmpty(key) ? "log_tag" : key, message);    }
}

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Hot-product

Best Watch Store

Popular Posts

Contact Form

Name

Email *

Message *