package com.sheep.gamegroup.util;

import android.util.Log;

/**
 * Created by realicing on 2018/5/12.
 * realicing@sina.com
 */
public class LogUtil {

    /**
     * isDebug ,debug环境下设成true，方便查看日志，release环境下设成false，减少打印信息的输出，
     */
    private static boolean isDebug = true;

    public static void println(Object... objects) {
        if (TestUtil.isTest()) {
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    stringBuilder.append(" ");
                }
                stringBuilder.append(objects[i]);
            }
            String msg = stringBuilder.toString();
            Log.i("println", ViewUtil.BLOCK + "\n" + msg);
        }
    }

    /**
     * @param message 需要打印的String,
     *                调用系统的Log.i(?,?);
     */
    public static void logI(String message){
        if (isDebug){
            Log.i("LOGI",message);
        }
    }
    /**
     * @param message 需要打印的String,
     *                  调用系统的Log.e(?,?);
     */
    public static void logE(String message){
        if (isDebug){
            Log.e("LOGE",message);
        }
    }
    /**
     * @param message 需要打印的String,
     *                  调用系统的Log.d(?,?);
     */
    public static void logD(String message){
        if (isDebug){
            Log.d("LOGD",message);
        }
    }

}
