Android Open Source - UniversalLoader U L Debugger






From Project

Back to project page UniversalLoader.

License

The source code is released under:

Apache License

If you think the Android project UniversalLoader 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.michaelflisar.universalloader.helper;
//from  w  w  w  .ja  v a  2 s. c o m
import android.util.Log;

import com.michaelflisar.universalloader.UniversalLoader;

public class ULDebugger
{
    public static enum DebugMode
    {
        SIMPLE,
        DETAILED
    }

    private static boolean mDebugEnabled = false;
    private static DebugMode mDebugMode = DebugMode.SIMPLE;
    
    public static void setDebugger(boolean enabled, DebugMode mode)
    {
        setDebug(enabled);
        setMode(mode);
    }

    protected static void setDebug(boolean enabled)
    {
        mDebugEnabled = enabled;
    }

    protected static void setMode(DebugMode mode)
    {
        mDebugMode = mode;
    }

    private static boolean isDebugRelevant(DebugMode mode)
    {
        if (mDebugEnabled && mode.ordinal() <= mDebugMode.ordinal())
            return true;
        return false;
    }

    public static void debug(DebugMode mode, Class<?> source, String message)
    {
        if (isDebugRelevant(mode))
            debug(source.getSimpleName() + ": " + message);
    }

    public static void debug(DebugMode mode, Object source, String message)
    {
        if (isDebugRelevant(mode))
            debug(source.getClass().getSimpleName() + "@" + Integer.toHexString(source.hashCode()) + ": " + message);
    }

    private static void debug(String message)
    {
        Log.d(UniversalLoader.class.getSimpleName(), message);
    }
}




Java Source Code List

com.michaelflisar.universalloader.ULActivity.java
com.michaelflisar.universalloader.ULFragmentImpl.java
com.michaelflisar.universalloader.UniversalLoader.java
com.michaelflisar.universalloader.data.fragments.ULFragmentLoaderData.java
com.michaelflisar.universalloader.data.fragments.ULFragmentLoaders.java
com.michaelflisar.universalloader.data.main.ULFragmentKey.java
com.michaelflisar.universalloader.data.main.ULKey.java
com.michaelflisar.universalloader.data.main.ULLoaderDataManager.java
com.michaelflisar.universalloader.data.main.ULResultManager.java
com.michaelflisar.universalloader.data.main.ULResult.java
com.michaelflisar.universalloader.data.main.ULTaskManager.java
com.michaelflisar.universalloader.data.main.ULTask.java
com.michaelflisar.universalloader.demo.Helper.java
com.michaelflisar.universalloader.demo.TestActivity.java
com.michaelflisar.universalloader.demo.TestLoaderFragment.java
com.michaelflisar.universalloader.fragments.ULDialogFragment.java
com.michaelflisar.universalloader.fragments.ULFragment.java
com.michaelflisar.universalloader.helper.ULDebugger.java
com.michaelflisar.universalloader.helper.ULHelper.java
com.michaelflisar.universalloader.interfaces.IFragmentImplParent.java
com.michaelflisar.universalloader.interfaces.IUniversalLoaderListener.java
com.michaelflisar.universalloader.interfaces.IUniversalLoaderProvider.java