flutter 长日志打印 并只在debug模式才打印 眼镜会飞 2021-11-03 669 阅读1分钟 import 'dart:developer'; /// todo:完整日志打印 logger(dynamic msg,{String? tag}){ const bool inProduction = const bool.fromEnvironment("dart.vm.product"); /// todo:只在debug模式执行 if(!inProduction){ log(msg,name: tag ?? 'flutter log'); } }