Android Open Source - slidingdebugmenu Log






From Project

Back to project page slidingdebugmenu.

License

The source code is released under:

Apache License

If you think the Android project slidingdebugmenu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package co.lemonlabs.android.slidingdebugmenu.util;
//from   w w  w . ja  v a 2 s  .c o  m
import org.json.JSONObject;

/**
 * Wrapper of core {@link android.util.Log} functions
 * to allow control using SlidingDebugMenu
 * <p/>
 * Created by balysv on 13/01/14.
 * www.lemonlabs.co
 */
public class Log {

    public static int LOG_LEVEL = 2;

    // VERBOSE

    public static void v(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.VERBOSE)
            android.util.Log.v(tag, message);
    }

    public static void v(String tag, boolean b) {
        v(tag, String.valueOf(b));
    }

    public static void v(String tag, int i) {
        v(tag, String.valueOf(i));
    }

    public static void v(String tag, JSONObject json) {
        v(tag, json.toString());
    }

    // DEBUG

    public static void d(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.DEBUG)
            android.util.Log.d(tag, message);
    }

    public static void d(String tag, boolean b) {
        d(tag, String.valueOf(b));
    }

    public static void d(String tag, int i) {
        d(tag, String.valueOf(i));
    }

    public static void d(String tag, JSONObject json) {
        d(tag, json.toString());
    }

    // INFO

    public static void i(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.INFO)
            android.util.Log.i(tag, message);
    }

    // WARN

    public static void w(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.WARN)
            android.util.Log.w(tag, message);
    }

    // ERROR
    public static void e(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.ERROR)
            android.util.Log.e(tag, message);
    }

    public static void e(String tag, String message, Throwable error) {
        if (LOG_LEVEL <= android.util.Log.ERROR)
            android.util.Log.e(tag, message, error);
    }

    public static void e(String tag, JSONObject json) {
        e(tag, json.toString());
    }

    // WTF
    public static void wtf(String tag, String message) {
        if (LOG_LEVEL <= android.util.Log.ASSERT)
            android.util.Log.wtf(tag, message);
    }

    public static void wtf(String tag, String message, Throwable error) {
        if (LOG_LEVEL <= android.util.Log.ASSERT)
            android.util.Log.wtf(tag, message, error);
    }

}




Java Source Code List

co.lemonlabs.android.slidingdebugmenu.SlidingDebugMenuModule.java
co.lemonlabs.android.slidingdebugmenu.SlidingDebugMenu.java
co.lemonlabs.android.slidingdebugmenu.controllers.LocationController.java
co.lemonlabs.android.slidingdebugmenu.controllers.NetworkController.java
co.lemonlabs.android.slidingdebugmenu.demo.DemoActivity.java
co.lemonlabs.android.slidingdebugmenu.demo.DemoModule.java
co.lemonlabs.android.slidingdebugmenu.demo.LocaleModule.java
co.lemonlabs.android.slidingdebugmenu.modules.BuildModule.java
co.lemonlabs.android.slidingdebugmenu.modules.LocationModule.java
co.lemonlabs.android.slidingdebugmenu.modules.LogModule.java
co.lemonlabs.android.slidingdebugmenu.modules.MenuModule.java
co.lemonlabs.android.slidingdebugmenu.modules.NetworkModule.java
co.lemonlabs.android.slidingdebugmenu.modules.events.LocationEvent.java
co.lemonlabs.android.slidingdebugmenu.modules.events.NetworkChangeEvent.java
co.lemonlabs.android.slidingdebugmenu.receivers.NetworkReceiver.java
co.lemonlabs.android.slidingdebugmenu.util.Log.java
co.lemonlabs.android.slidingdebugmenu.views.ModuleSimpleProperty.java
co.lemonlabs.android.slidingdebugmenu.views.ModuleSpinnerProperty.java
co.lemonlabs.android.slidingdebugmenu.views.ModuleTitle.java