Browse Source

加入人脸识别页面的操作日志

gavin.chen 1 year ago
parent
commit
74721ab098
1 changed files with 6 additions and 0 deletions
  1. 6 0
      lib/pages/facial_recognition/controller.dart

+ 6 - 0
lib/pages/facial_recognition/controller.dart

@@ -187,6 +187,7 @@ class FacialRecognitionController extends GetxController
 
   /// 遍历当前相机列表并启动后置相机
   void openBackCamera() async {
+    logger.i("openBackCamera 启动前置摄像头");
     if (_cameras.isEmpty) {
       PromptBox.toast('Error: No cameras found.');
     } else {
@@ -205,6 +206,7 @@ class FacialRecognitionController extends GetxController
 
   /// 遍历当前相机列表并启动前置相机
   void openFrontCamera() async {
+    logger.i("openFrontCamera 启动后置摄像头");
     if (_cameras.isEmpty) {
       PromptBox.toast('Error: No cameras found.');
     } else {
@@ -374,6 +376,7 @@ class FacialRecognitionController extends GetxController
 
   /// 人脸识别逻辑
   void doFacialRecognition() async {
+    logger.i("doFacialRecognition 进行人脸识别 $doFacialRecognitionTimes");
     doFacialRecognitionTimes++;
     if (doFacialRecognitionTimes >= 10) {
       // 尝试十次后宣告失败
@@ -587,6 +590,8 @@ class FacialRecognitionController extends GetxController
   @override
   void onReady() async {
     super.onReady();
+    logger.i(
+        "onReady 进入人脸识别/采集页面,当前模式:${mode == FacialRecognitionMode.faceRecognition ? '人脸识别' : '人像采集'}");
     await initAvailableCameras();
     if (state.isUsingFrontCamera) {
       openFrontCamera();
@@ -598,6 +603,7 @@ class FacialRecognitionController extends GetxController
   /// 在 [onDelete] 方法之前调用。
   @override
   void onClose() {
+    logger.i("onClose 离开人脸识别/采集页面");
     super.onClose();
     final cacheManager = Get.find<ICacheManager>();
     cacheManager.clearApplicationImageCache();