【android】利用BuildConfig.DEBUG來控制日誌的輸出
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
package org.flyingcat.util;
import android.util.Log; /**
*
@author Flyingcat
*
@create 2014-4-23
*
@version 1.0
*/
public class AppLog
{
private static final boolean LOG_DEBUG
= true ;
public void d(String
tag, String msg){
if (LOG_DEBUG){
Log.i(tag,
msg);
}
}
//省略過載方法……
}
|
1 2 3 4 5 |
/**
Automatically generated file. DO NOT MODIFY */
package org.flyingcat.androidcodelib;
public final class BuildConfig
{
public final static boolean DEBUG
= true ;
}
|
1 2 3 4 |
Added
a feature that allows you to run some code only in debug mode.
|