本文整理汇总了Java中com.logg.Logg类的典型用法代码示例。如果您正苦于以下问题:Java Logg类的具体用法?Java Logg怎么用?Java Logg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Logg类属于com.logg包,在下文中一共展示了Logg类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCurrentStackTrace
import com.logg.Logg; //导入依赖的package包/类
/**
* 获取当前堆栈信息
*
* @return
*/
private StackTraceElement getCurrentStackTrace() {
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
int stackOffset = -1;
for (int i = 5; i < trace.length; i++) {
StackTraceElement e = trace[i];
if (Logg.class.equals(Logger.class) && i < trace.length - 1 && trace[i + 1].getClassName()
.equals(Logger.class.getName())) {
continue;
}
if (e.getClassName().equals(Logg.class.getName())) {
stackOffset = ++i;
}
}
return stackOffset != -1 ? trace[stackOffset] : null;
}
示例2: create
import com.logg.Logg; //导入依赖的package包/类
@Override
public void create(Bundle savedInstanceState) {
// RecyclerView
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter = new SearchAdapter());
Logg.e("onCreate");
// 检查蓝牙权限处理
this.bluetoothScanCheck();
}
示例3: startScan
import com.logg.Logg; //导入依赖的package包/类
/**
* 开启扫描
*/
private void startScan() {
Logg.e("startScan");
detector = BluetoothDetector.getInstance();
// 配置一些过滤条件
BluetoothFilter filter = BluetoothFilter.builder()
.addDeviceAddress("20:CD:39:B0:7A:7C")// 55
.addDeviceAddress("20:CD:39:B0:7A:59")// 73
.addDeviceAddress("20:CD:39:B0:7A:62")// 78
.addDeviceAddress("20:CD:39:B0:71:4B")// 94
.addDeviceAddress("20:CD:39:B0:6E:40")// 148
.addDeviceAddress("20:CD:39:B0:7A:4A")// 162
.debug(true)
.build();
detector.startScan(filter, new BluetoothDetectorCallBack() {
@Override
public void onScan(final BluetoothDevice device, final int rssi, final byte[] scanRecord) {
Logg.e(device.getAddress() + " " + device.getName());
runOnUiThread(new Runnable() {
@Override
public void run() {
String summary = adapter.update(device, rssi, scanRecord);
if (summary != null) {
// Logg.e("summary " + summary);
}
}
});
}
});
}
示例4: onCreate
import com.logg.Logg; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
LoggConfiguration configuration = new LoggConfiguration.Buidler()
.setDebug(true)
// .setTag("test")// 自定义全局Tag
.build();
Logg.init(configuration);
}
示例5: onReceive
import com.logg.Logg; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
if (NetWorkUtils.isWifiConnected(context)) {
type = Type.WIFI;
} else if (NetWorkUtils.isMobileConnected(context)) {
type = Type.MOBILE;
} else {
type = Type.NONE;
}
Logg.e("The network has changed, code = " + type.value);
}
}
示例6: bluetoothScanCheck
import com.logg.Logg; //导入依赖的package包/类
/**
* 检查蓝牙权限处理
*/
private boolean bluetoothScanCheck() {
if (!BluetoothUtils.isSupportBluetooth()) {// 是否支持蓝牙
Logg.e("设备没有蓝牙模块");
showMessage("设备没有蓝牙模块");
return false;
}
if (!BluetoothUtils.isOpenBluetooth() && !BluetoothUtils.openBluetooth()) {// 检查蓝牙是否开启,并尝试强制开启蓝牙
Logg.e("开启蓝牙失败,请打开系统设置页面手动开启");
showMessage("开启蓝牙失败,请打开系统设置页面手动开启");
BluetoothUtils.openBluetooth(this, BluetoothUtils.REQUEST_CODE_BLUETOOTH);
return false;
}
if (!BluetoothUtils.isOpenGPS(this)) {// 启动 GPS 定位服务
Logg.e("启动 GPS 定位服务");
showMessage("请开启 GPS 定位服务");
BluetoothUtils.openGps(this, BluetoothUtils.REQUEST_CODE_GPS);
return false;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {// Android 6.0 以上版本,需要申请地理位置权限
Logg.e("Android 6.0 以上版本,需要申请地理位置权限");
PermissionUtils.location(new PermissionUtils.RequestPermission() {
@Override
public void onRequestPermissionSuccess() {
Logg.e("onRequestPermissionSuccess");
// 开启扫描
startScan();
}
@Override
public void onRequestPermissionFailure() {
showMessage("请开启地理位置权限");
// 如果失败跳到到应用设置页面
BluetoothUtils.openPermissionsSetting(MainActivity.this);
}
}, new RxPermissions(this));
}
return true;
}
示例7: logTest
import com.logg.Logg; //导入依赖的package包/类
private void logTest() {
btnDefaultLog = (Button) findViewById(R.id.btn_default_log);
btnJsonLog = (Button) findViewById(R.id.btn_json_log);
btnXMLLog = (Button) findViewById(R.id.btn_xml_log);
btnBigLog = (Button) findViewById(R.id.btn_big_log);
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_default_log:
// 基本数据类型 byte short int long float double char boolean
Logg.v(3.1415926);
String[] str = {"aaaaaaaa","bbbbb"};
Logg.v(str);
Logg.v("test", 3.1415926);
// 数组
Logg.d(DataHelper.getArray());
// Map
Logg.i(DataHelper.getMap());
// List
Logg.w(DataHelper.getList());
// Intent
Logg.e(DataHelper.getIntent());
break;
case R.id.btn_json_log:
Logg.json(DataHelper.getJsonArray());
Logg.json(DataHelper.getJson());
break;
case R.id.btn_xml_log:
Logg.xml(DataHelper.getXml());
break;
case R.id.btn_big_log:
Logg.d(DataHelper.getBigString(MainActivity.this));
break;
default:
break;
}
}
};
btnDefaultLog.setOnClickListener(onClickListener);
btnJsonLog.setOnClickListener(onClickListener);
btnXMLLog.setOnClickListener(onClickListener);
btnBigLog.setOnClickListener(onClickListener);
// 添加一个拦截器
Logg.addInterceptor(new TestInterceptor());
// 添加一个全局监听
GlobalCallback.getInstance().addCallback(new LoggCallback() {
@Override
public void logg(Type type, String tag, String message) {
Log.e(tag, message);
}
});
}
示例8: log
import com.logg.Logg; //导入依赖的package包/类
@Override
public void log(String message) {
Logg.e(message);
}
示例9: applyGlideOptions
import com.logg.Logg; //导入依赖的package包/类
@Override
public void applyGlideOptions(Context context, GlideBuilder builder) {
Logg.w("applyGlideOptions");
}