Android Open Source - Webby Webby Log






From Project

Back to project page Webby.

License

The source code is released under:

MIT License

If you think the Android project Webby 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 com.swampmobile.webby.util.logging;
/*from ww w . j  av a 2s .  c o  m*/
import android.util.Log;

/**
 * Created by Matt on 4/14/14.
 */
public class WebbyLog
{
    private static LogLevel currentLogLevel = LogLevel.VERBOSE;

    public static enum LogLevel
    {
        VERBOSE(50),
        DEBUG(40),
        INFO(30),
        WARN(20),
        ERROR(10),
        WTF(0);

        private int logLevel;

        private LogLevel(int logLevel)
        {
            this.logLevel = logLevel;
        }

        public boolean shouldLog()
        {
            return currentLogLevel.logLevel >= this.logLevel;
        }
    }

    public static void setLogLevel(LogLevel logLevel)
    {
        currentLogLevel = logLevel;
    }

    public static void v(String tag, String msg)
    {
        if(LogLevel.VERBOSE.shouldLog())
            Log.v(tag, msg);
    }

    public static void d(String tag, String msg)
    {
        if(LogLevel.DEBUG.shouldLog())
            Log.d(tag, msg);
    }

    public static void i(String tag, String msg)
    {
        if(LogLevel.INFO.shouldLog())
            Log.i(tag, msg);
    }

    public static void w(String tag, String msg)
    {
        if(LogLevel.WARN.shouldLog())
            Log.w(tag, msg);
    }

    public static void e(String tag, String msg)
    {
        if(LogLevel.ERROR.shouldLog())
            Log.e(tag, msg);
    }

    public static void e(String tag, String msg, Throwable e)
    {
        if(LogLevel.ERROR.shouldLog())
            Log.e(tag, msg, e);
    }

    public static void wtf(String tag, String msg)
    {
        if(LogLevel.WTF.shouldLog())
            Log.wtf(tag, msg);
    }

}




Java Source Code List

com.swampmobile.webby.WebbyManager.java
com.swampmobile.webby.Webby.java
com.swampmobile.webby.examples.activities.MainActivity.java
com.swampmobile.webby.examples.activities.WebbyActivity.java
com.swampmobile.webby.examples.activities.WebbyFragmentActivity.java
com.swampmobile.webby.examples.apis.FeedzillaApi.java
com.swampmobile.webby.examples.fragments.WebbyFragment.java
com.swampmobile.webby.examples.requests.TestWebbyRequest.java
com.swampmobile.webby.requests.WebbyRequest.java
com.swampmobile.webby.requests.WebbyResponse.java
com.swampmobile.webby.services.WebbyService.java
com.swampmobile.webby.util.cache.DataCache.java
com.swampmobile.webby.util.cache.FlatFileDataCache.java
com.swampmobile.webby.util.logging.WebbyLog.java
com.swampmobile.webby.util.time.Duration.java