class LogUtil {
static const String _TAG_DEF = "###common_utils###";
static bool debuggable = false;
static String TAG = _TAG_DEF;
static void init({bool isDebug = false, String tag = _TAG_DEF}) {
debuggable = isDebug;
TAG = tag;
}
static void e(Object object, {String tag}) {
_printLog(tag, ' e ', object);
}
static void v(Object object, {String tag}) {
if (debuggable) {
_printLog(tag, ' v ', object);
}
}
static void _printLog(String tag, String stag, Object object) {
StringBuffer sb = new StringBuffer();
sb.write((tag == null || tag.isEmpty) ? TAG : tag);
sb.write(stag);
sb.write(object);
print(sb.toString());
}
}