// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Context getContext() {
//     return context != null
//             ? context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/extensions/CollectionExtensions.java
// public static boolean isEmpty(@Nullable final Collection<?> collection) {
//     return collection == null || collection.isEmpty();
// }


import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import static com.common.android.utils.ContextHelper.getContext;
import static com.common.android.utils.extensions.CollectionExtensions.isEmpty;
package com.common.android.utils.logging;




/**
 * Static logging facet for concrete device specific logger.
 * Depending on Logging level it shows only higher prioritized logs.
 * For instance: if the Logging Level is set to info, no debug messages will be shown, etc.
 */
final public class Logger {

    /**
     * Logging level.
     */
    @NonNull
    private static Level logLevel = Level.DEBUG;
    /**
     * Concrete Logger.
     */
    @Nullable
    private static final List<ILogger> loggers = new ArrayList<>();

    /**
     * Constructor.
     *
     * @param logger - Concrete Logger.
     */
    public static void addLogger(@NonNull final ILogger logger) {
        Logger.loggers.add(logger);
    }

    /**
     * Constructor.
     *
     * @param logger - Concrete Logger.
     * @param level  - Logging level.
     */
    private static void addLogger(@NonNull final ILogger logger, @NonNull final Level level) {
        addLogger(logger);
        Logger.logLevel = level;
    }

    /**
     * Gets Logging level.
     *
     * @return Currently set logging level.
     */
    @NonNull
    public static Level getLogLevel() {
        return logLevel;
    }

    /**
     * Sets new Logging level.
     *
     * @param logLevel new logging level.
     */
    public static void setLogLevel(@NonNull final Level logLevel) {
        if (isEmpty(loggers))
            addLogger(new LogcatLogger());
        else
            Logger.logLevel = logLevel;
    }

    /**
     * Checks against logging level.
     *
     * @param level - Defined logging level.
     * @return true if logging is allowed.
     */
    private static boolean allowLogging(@NonNull final Level level) {
// Path: common-android-utils/src/main/java/com/common/android/utils/ContextHelper.java
// @Nullable
// public static Context getContext() {
//     return context != null
//             ? context.get()
//             : null;
// }
// 
// Path: common-android-utils/src/main/java/com/common/android/utils/extensions/CollectionExtensions.java
// public static boolean isEmpty(@Nullable final Collection<?> collection) {
//     return collection == null || collection.isEmpty();
// }


// Path: common-android-utils/src/main/java/com/common/android/utils/logging/Logger.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import static com.common.android.utils.ContextHelper.getContext;
import static com.common.android.utils.extensions.CollectionExtensions.isEmpty;

package com.common.android.utils.logging;




/**
 * Static logging facet for concrete device specific logger.
 * Depending on Logging level it shows only higher prioritized logs.
 * For instance: if the Logging Level is set to info, no debug messages will be shown, etc.
 */
final public class Logger {

    /**
     * Logging level.
     */
    @NonNull
    private static Level logLevel = Level.DEBUG;
    /**
     * Concrete Logger.
     */
    @Nullable
    private static final List<ILogger> loggers = new ArrayList<>();

    /**
     * Constructor.
     *
     * @param logger - Concrete Logger.
     */
    public static void addLogger(@NonNull final ILogger logger) {
        Logger.loggers.add(logger);
    }

    /**
     * Constructor.
     *
     * @param logger - Concrete Logger.
     * @param level  - Logging level.
     */
    private static void addLogger(@NonNull final ILogger logger, @NonNull final Level level) {
        addLogger(logger);
        Logger.logLevel = level;
    }

    /**
     * Gets Logging level.
     *
     * @return Currently set logging level.
     */
    @NonNull
    public static Level getLogLevel() {
        return logLevel;
    }

    /**
     * Sets new Logging level.
     *
     * @param logLevel new logging level.
     */
    public static void setLogLevel(@NonNull final Level logLevel) {
        if (isEmpty(loggers))
            addLogger(new LogcatLogger());
        else
            Logger.logLevel = logLevel;
    }

    /**
     * Checks against logging level.
     *
     * @param level - Defined logging level.
     * @return true if logging is allowed.
     */
    private static boolean allowLogging(@NonNull final Level level) {
        if (isEmpty(loggers))