本文整理匯總了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");
}