Skip to content

Commit

Permalink
feat: 更新部分 DevComponent Engine Log 代码
Browse files Browse the repository at this point in the history
Former-commit-id: 6944df7
Former-commit-id: 4d0ccbf
  • Loading branch information
afkT committed May 19, 2022
1 parent e9391bd commit 3f50c6a
Show file tree
Hide file tree
Showing 37 changed files with 170 additions and 332 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}

override fun onFail(error: Throwable) {
log_eTag(
tag = TAG,
TAG.log_eTag(
throwable = error,
message = "getNetTime"
)
Expand All @@ -60,8 +59,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
Manifest.permission.WRITE_EXTERNAL_STORAGE
), object : IPermissionEngine.Callback {
override fun onGranted() {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "permission granted"
)
}
Expand All @@ -71,8 +69,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
deniedList: List<String>,
notFoundList: List<String>
) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("permission")
append("\ngrantedList: ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ class ProgressManagerUse private constructor() {
}
}
if (progressId == progress.getId()) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("onStart - ").append(progress.getId())
append(", totalSize: ").append(progress.getTotalSize())
Expand All @@ -180,8 +179,7 @@ class ProgressManagerUse private constructor() {
*/
override fun onProgress(progress: Progress) {
if (progressId == progress.getId()) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("onProgress - ").append(progress.getId())
append(", totalSize: ").append(progress.getTotalSize())
Expand All @@ -199,8 +197,7 @@ class ProgressManagerUse private constructor() {
*/
override fun onError(progress: Progress) {
if (progressId == progress.getId()) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("onError - ").append(progress.getId())
append(", totalSize: ").append(progress.getTotalSize())
Expand All @@ -219,8 +216,7 @@ class ProgressManagerUse private constructor() {
*/
override fun onFinish(progress: Progress) {
if (progressId == progress.getId()) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("onFinish - ").append(progress.getId())
append(", 网速: ").append(progress.getSpeed().getSpeedFormatSecond())
Expand All @@ -237,8 +233,7 @@ class ProgressManagerUse private constructor() {
*/
override fun onEnd(progress: Progress) {
if (progressId == progress.getId()) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = StringBuilder().apply {
append("onEnd - ").append(progress.getId())
append(", 网速: ").append(progress.getSpeed().getSpeedFormatSecond())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static <T extends AbsGreenDatabase> T database(
try {
sDatabaseMaps.put(databaseName, CREATE.create(dbName, password, clazz));
} catch (Exception e) {
log_eTag(null, TAG, e, "database");
log_eTag(TAG, null, e, "database");
}
}
AbsGreenDatabase greenDatabase = sDatabaseMaps.get(databaseName);
Expand All @@ -84,7 +84,7 @@ public static <T extends AbsGreenDatabase> T database(
try {
db = (T) greenDatabase;
} catch (Exception e) {
log_eTag(null, TAG, e, "database convert T");
log_eTag(TAG, null, e, "database convert T");
}
return db;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static <T extends AbsRoomDatabase> T database(
try {
sDatabaseMaps.put(databaseName, CREATE.create(dbName, password, clazz));
} catch (Exception e) {
log_eTag(null, TAG, e, "database");
log_eTag(TAG, null, e, "database");
}
}
AbsRoomDatabase roomDatabase = sDatabaseMaps.get(databaseName);
Expand All @@ -83,7 +83,7 @@ public static <T extends AbsRoomDatabase> T database(
try {
db = (T) roomDatabase;
} catch (Exception e) {
log_eTag(null, TAG, e, "database convert T");
log_eTag(TAG, null, e, "database convert T");
}
return db;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ class DevAssistEngineActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
TAG, "Log Engine 方法调用"
)

log_dTag(
tag = TAG,
TAG.log_dTag(
message = "Log Engine 方法调用"
)

Expand All @@ -117,9 +116,8 @@ class DevAssistEngineActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
TAG, "多 Log Engine 方法调用"
)

log_dTag(
TAG.log_dTag(
engine = KEY,
tag = TAG,
message = "多 Log Engine 方法调用"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class DevEnvironmentLibActivity : BaseActivity<BaseViewRecyclerviewBinding>() {

val content = toString()
ToastTintUtils.normal(content)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = content
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ class ScanShapeActivity : BaseActivity<ActivityScanShapeBinding>() {
try {
cameraAssist.stopPreview()
} catch (e: Exception) {
log_eTag(
tag = TAG,
TAG.log_eTag(
throwable = e,
message = "surfaceDestroyed"
)
Expand Down Expand Up @@ -156,8 +155,7 @@ class ScanShapeActivity : BaseActivity<ActivityScanShapeBinding>() {
// // 默认开启自动对焦, 设置不需要自动对焦
// cameraAssist.setAutoFocus(false)
} catch (e: Exception) {
log_eTag(
tag = TAG,
TAG.log_eTag(
throwable = e,
message = "checkPermission startPreview"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ class ViewPagerActivity : BaseActivity<ActivityViewPagerBinding>() {
right: Boolean
) {
if (left && !right) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "往左滑 - 从右往左"
)
} else {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "往右滑 - 从左往右"
)
}
}

override fun onPageSelected(index: Int) {
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "索引变动: $index"
)
if (mLeftScroll) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class EventBusActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventBus(event: DevObject<String>) {
// 打印数据
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "value ${event.getObject()}"
)
// 进行提示
Expand All @@ -82,8 +81,7 @@ class EventBusActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
fun onEventBusSticky(event: DevObject<String>) {
// 打印数据
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "value ${event.getObject()}"
)
// 进行提示
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class GreenDaoActivity : BaseActivity<ActivityDatabaseBinding>() {
limit = pageSize * 2 - diff
}
}
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "offset: $offset, limit: $limit"
)
// 请求数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class RoomActivity : BaseActivity<ActivityDatabaseBinding>() {
.deleteNotePictures(
*CollectionUtils.toArrayT(nap.pictures)
)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "删除图片数量: $deleteCount"
)
}
Expand Down Expand Up @@ -231,8 +230,7 @@ class RoomActivity : BaseActivity<ActivityDatabaseBinding>() {
limit = pageSize * 2 - diff
}
}
log_dTag(
tag = TAG,
TAG.log_dTag(
message = "offset: $offset, limit: $limit"
)
// 请求数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,15 @@ class FunctionActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
ButtonValue.BTN_FUNCTION_MEMORY_PRINT -> {
val memoryInfo = MemoryUtils.printMemoryInfo()
ToastUtils.showShort(memoryInfo)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = memoryInfo
)
}
ButtonValue.BTN_FUNCTION_DEVICE_PRINT -> {
val deviceInfo =
DeviceUtils.handlerDeviceInfo(DeviceUtils.getDeviceInfo(), "")
ToastUtils.showShort(deviceInfo)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = deviceInfo
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class PathActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
PathUtils.getInternal().appAudiobooksDir,
""
)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = builder.toString()
)
showToast(true, "信息已打印, 请查看 Logcat")
Expand Down Expand Up @@ -144,8 +143,7 @@ class PathActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
PathUtils.getAppExternal().appObbDir,
""
)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = builder.toString()
)
showToast(true, "信息已打印, 请查看 Logcat")
Expand Down Expand Up @@ -185,8 +183,7 @@ class PathActivity : BaseActivity<BaseViewRecyclerviewBinding>() {
PathUtils.getSDCard().audiobooksDir,
""
)
log_dTag(
tag = TAG,
TAG.log_dTag(
message = builder.toString()
)
showToast(true, "信息已打印, 请查看 Logcat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,15 @@ class FloatingView(
override fun onAttachedToWindow() {
super.onAttachedToWindow()

log_dTag(
tag = TAG,
TAG.log_dTag(
message = "onAttachedToWindow"
)
}

override fun onDetachedFromWindow() {
super.onDetachedFromWindow()

log_dTag(
tag = TAG,
TAG.log_dTag(
message = "onDetachedFromWindow"
)
}
Expand Down
Loading

0 comments on commit 3f50c6a

Please sign in to comment.