refactor: 优化日志输出,仅在调试模式下启用

- 为所有 print 语句添加 kDebugMode 检查
- 更新 KRLogUtil 工具类,Release 模式下禁用日志输出
- 优化 18 个文件中的 335+ 条日志语句
- 提升 Release 版本性能并增强安全性

(cherry picked from commit 301f1510ba81fe94fb08e013ca80b3ca708a2e15)
This commit is contained in:
2025-11-01 05:15:34 -07:00
committed by speakeloudest
parent b3ee1cc6dc
commit 4c5763647d
18 changed files with 665 additions and 232 deletions
@@ -5,6 +5,7 @@ import 'package:latlong2/latlong.dart';
import '../../../utils/kr_fm_tc.dart';
import '../controllers/kr_home_controller.dart';
import '../../../utils/kr_log_util.dart';
import 'package:flutter/foundation.dart';
/// 首页地图视图组件
class KRHomeMapView extends GetView<KRHomeController> {
@@ -187,12 +188,16 @@ return GetBuilder<KRHomeController>(
/// 构建样式化的标记
Marker _buildStyledMarker(dynamic node) {
print("原始Marker${node}");
if (kDebugMode) {
print("原始Marker${node}");
}
int type = 0;
MaterialColor markerColor = Colors.grey;
//如果没订阅过,就是灰色
bool status = controller.kr_isConnected.value;
print("连接状态:$status");
if (kDebugMode) {
print("连接状态:$status");
}
if(status){
if (node.urlTestDelay.value == 0) {
// 延迟为0时使用默认颜色