Просмотр исходного кода

【优化】打印日志整体调整debug模式

lizhe 1 год назад
Родитель
Сommit
c0f10b397e
79 измененных файлов с 1236 добавлено и 1192 удалено
  1. 949 870
      PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  2. 5 5
      PDF Office/PDF Master/AppDelegate.swift
  3. 9 9
      PDF Office/PDF Master/Class/ComponentLibrary/KMDesignToken.swift
  4. 9 9
      PDF Office/PDF Master/Class/Home/Category/NSViewController+DesignToken.swift
  5. 1 1
      PDF Office/PDF Master/Class/Home/Tools/KMCloudDocumentTools.swift
  6. 4 4
      PDF Office/PDF Master/Class/Home/ViewController/KMAIOpenPDFFilesVC.swift
  7. 3 3
      PDF Office/PDF Master/Class/Home/ViewController/KMAITranslationVC.swift
  8. 1 1
      PDF Office/PDF Master/Class/Home/ViewController/KMHistoryFileCollectionViewItem.swift
  9. 9 9
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift
  10. 14 14
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift
  11. 2 2
      PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationConfirmWindowController.swift
  12. 2 2
      PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.swift
  13. 2 2
      PDF Office/PDF Master/Class/KMLightMember/Cache/KMLightMemberCache.swift
  14. 5 5
      PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift
  15. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/View/KMAccountInfoView.swift
  16. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Cancellation/KMCancellationWindowController.swift
  17. 7 7
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift
  18. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/KMComparativeOutlineView.swift
  19. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/Manager/KMComparativeManager.swift
  20. 2 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift
  21. 6 6
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.swift
  22. 5 5
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift
  23. 2 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginInputPasswordView.swift
  24. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.swift
  25. 3 3
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginView.swift
  26. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMRegisterSuccessView.swift
  27. 6 6
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMRegisterView.swift
  28. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMResetPasswordView.swift
  29. 1 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/SubscribeSuccess/KMSubscribeSuccessWindowController.swift
  30. 7 9
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift
  31. 5 5
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift
  32. 6 6
      PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/KMVerficationCodeWindowController.swift
  33. 4 4
      PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift
  34. 20 20
      PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift
  35. 2 2
      PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/DMG/KMDMGPurchaseManager.swift
  36. 13 31
      PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/KMPurchaseManager.swift
  37. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Manager/KMLightMemberManager.swift
  38. 4 4
      PDF Office/PDF Master/Class/KMLightMember/Manager/KMRequestServerManager.swift
  39. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Model/KMLightMemberToken.swift
  40. 1 1
      PDF Office/PDF Master/Class/Merge/Controller/KMMergeViewController.swift
  41. 1 1
      PDF Office/PDF Master/Class/PDFTools/Background/tool/KMBackgroundManager.swift
  42. 4 4
      PDF Office/PDF Master/Class/PDFTools/Batch/KMBatchWindowController.swift
  43. 1 1
      PDF Office/PDF Master/Class/PDFTools/Batch/View/Choose/ConvertPDF/KMBatchConvertPDFView.swift
  44. 14 14
      PDF Office/PDF Master/Class/PDFTools/Batch/View/Choose/KMBatchSettingView.swift
  45. 1 1
      PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift
  46. 4 4
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/KMImageToPDFWindowController.swift
  47. 9 9
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/Manager/KMImageToPDFManager.swift
  48. 2 2
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/KMBatchProcessingView.swift
  49. 4 4
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/SelectedFiles/KMBatchSelectedFilesView.swift
  50. 2 2
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/Tableview/KMBatchProcessingTableView.swift
  51. 1 1
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/Tableview/KMBatchProcessingTableViewModel/KMBatchProcessingTableViewModel.swift
  52. 1 1
      PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMImageToPDFChooseView/KMImageToPDFChooseView.swift
  53. 4 4
      PDF Office/PDF Master/Class/PDFTools/OCR/KMOCRWindowController.swift
  54. 1 1
      PDF Office/PDF Master/Class/PDFTools/OCR/Presenter/KMOCRPresenter.swift
  55. 1 1
      PDF Office/PDF Master/Class/PDFTools/OCR/View/KMOCRChooseView/KMOCRChooseView.swift
  56. 6 6
      PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift
  57. 3 3
      PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter.swift
  58. 8 8
      PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter_C.swift
  59. 6 6
      PDF Office/PDF Master/Class/PDFTools/Tools/TextField/KMBaseTextField.swift
  60. 1 1
      PDF Office/PDF Master/Class/PDFTools/Watermark/Tools/KMWatermarkManager.swift
  61. 11 11
      PDF Office/PDF Master/Class/PDFWindowController/ReadModelView/KMReadModelView.swift
  62. 3 3
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift
  63. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMScreenViewController/ScreenCollectionView/View/KMAnnotationScreenTypeViewItem.swift
  64. 0 8
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMAnnotationTableRowView.swift
  65. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/BookMarks/KMBookMarkViewController.swift
  66. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Outline/KMOutlineViewController.swift
  67. 0 3
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Outline/OutlineView/KMBOTAOutlineView.swift
  68. 0 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMSearchViewController.swift
  69. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMPDFThumbnailView.swift
  70. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/CipherTextView/CipherTextView.swift
  71. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/Category/KMImageOptimization.swift
  72. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.swift
  73. 0 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift
  74. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/Manager/KMEditPDFTextManager.swift
  75. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/View/AlignmentView/KMEditPropertyAlignmentView.swift
  76. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  77. 6 6
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  78. 10 10
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  79. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/Views/KMPageNumberDisplayView/KMPageNumberDisplayView.swift

Разница между файлами не показана из-за своего большого размера
+ 949 - 870
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist


+ 5 - 5
PDF Office/PDF Master/AppDelegate.swift

@@ -110,8 +110,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
             if let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue,
                let url = URL(string: urlString) {
                 // 在这里处理收到的 URL Scheme
-                print("Received URL Scheme: \(url.scheme ?? "")")
-                print("Path: \(url.path)")
+                KMPrint("Received URL Scheme: \(url.scheme ?? "")")
+                KMPrint("Path: \(url.path)")
                 
                 #if VERSION_DMG
                 // 执行相应的操作
@@ -374,7 +374,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
         if KMLightMemberManager.manager.isLogin() {
             KMRequestServerManager.manager.logout { success, result in
                 if success {
-                    print("登出成功")
+                    KMPrint("登出成功")
                 }
             }
         }
@@ -477,11 +477,11 @@ extension AppDelegate : NSMenuDelegate,NSMenuItemValidation {
     }
     
     @objc func clickOutline(menuItem: NSMenuItem) {
-        print("更新菜单栏")
+        KMPrint("更新菜单栏")
     }
     
     func menuNeedsUpdate(_ menu: NSMenu) {
-        print("menuNeedsUpdate")
+        KMPrint("menuNeedsUpdate")
 //            menu.removeAllItems()
 //
 //            var item = NSMenuItem()

+ 9 - 9
PDF Office/PDF Master/Class/ComponentLibrary/KMDesignToken.swift

@@ -206,7 +206,7 @@ import Cocoa
                 let sizingNode = tokenDict["sizing"]
                 if nodeIsEmpty(control: sizing, node: sizingNode as Any) {
                     if sizingNodeUsesAction(control: sizing, node: sizingNode as Any) {
-                        print("sizing node user success")
+                        KMPrint("sizing node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -259,7 +259,7 @@ import Cocoa
                 }
                 if nodeIsEmpty(control: control as Any, node: node as Any) {
                     if layoutConstraintNodeUsesAction(control: control as Any, node: node as Any) {
-                        print("node user success")
+                        KMPrint("node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -272,7 +272,7 @@ import Cocoa
                 let fillNode = tokenDict["fill"]
                 if nodeIsEmpty(control: fill, node: fillNode as Any) {
                     if fillNodeUsesAction(control: fill, node: fillNode as Any) {
-                        print("fill node user success")
+                        KMPrint("fill node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -284,7 +284,7 @@ import Cocoa
                 let borderNode = tokenDict["border"]
                 if nodeIsEmpty(control: border, node: borderNode as Any) {
                     if borderNodeUsesAction(control: border, node: borderNode as Any) {
-                        print("border node user success")
+                        KMPrint("border node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -296,7 +296,7 @@ import Cocoa
                 let borderColorNode = tokenDict["borderColor"]
                 if nodeIsEmpty(control: borderColor, node: borderColorNode as Any) {
                     if borderColorNodeUsesAction(control: borderColor, node: borderColorNode as Any) {
-                        print("borderColor node user success")
+                        KMPrint("borderColor node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -308,7 +308,7 @@ import Cocoa
                 let borderRadiusNode = tokenDict["borderRadius"]
                 if nodeIsEmpty(control: borderRadius, node: borderRadiusNode as Any) {
                     if borderRadiusNodeUsesAction(control: borderRadius, node: borderRadiusNode as Any) {
-                        print("borderRadius node user success")
+                        KMPrint("borderRadius node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -320,7 +320,7 @@ import Cocoa
                 let borderWidthNode = tokenDict["borderWidth"]
                 if nodeIsEmpty(control: borderWidth, node: borderWidthNode as Any) {
                     if borderWidthNodeUsesAction(control: borderWidth, node: borderWidthNode as Any) {
-                        print("borderWidth node user success")
+                        KMPrint("borderWidth node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -332,7 +332,7 @@ import Cocoa
                 let boxShadowNode = tokenDict["boxShadow"]
                 if nodeIsEmpty(control: boxShadow, node: boxShadowNode as Any) {
                     if boxShadowNodeUsesAction(control: boxShadow, node: boxShadowNode as Any) {
-                        print("boxShadow node user success")
+                        KMPrint("boxShadow node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }
@@ -344,7 +344,7 @@ import Cocoa
                 let typographyNode = tokenDict["typography"]
                 if nodeIsEmpty(control: typography, node: typographyNode as Any) {
                     if typographyNodeUsesAction(control: typography, node: typographyNode as Any) {
-                        print("typography node user success")
+                        KMPrint("typography node user success")
                     } else {
                         return tokenUsesModel(withToken: token)
                     }

+ 9 - 9
PDF Office/PDF Master/Class/Home/Category/NSViewController+DesignToken.swift

@@ -384,7 +384,7 @@ import Foundation
                 KMDesignToken.shared.buttonDesignToken(bgToken: bg, textToken: text, heightConstraint: height, control: self as! KMDesignButton, state: state)
             }
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
         }
     }
     
@@ -394,7 +394,7 @@ import Foundation
         if self is KMDesignDropdown {
             KMDesignToken.shared.dropdownDesignToken(bgToken: bg, textToken: text, heightConstraint: height, control: self as! KMDesignDropdown, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignDropdown 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignDropdown 对象")
         }
     }
     
@@ -404,7 +404,7 @@ import Foundation
         if self is CTTabController {
             KMDesignToken.shared.multiTabDesignToken(bgToken: bg, textToken: text, heightConstraint: height, control: self as! CTTabController, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 CTTabController 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 CTTabController 对象")
         }
     }
 
@@ -413,7 +413,7 @@ import Foundation
         if self is KMFastToolCollectionViewItem {
             KMDesignToken.shared.cardDesignToken(bgToken: bg, titleText: titleText, descText: descText, spacing: spacing, control: self as! KMFastToolCollectionViewItem, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMFastToolCollectionViewItem 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMFastToolCollectionViewItem 对象")
         }
     }
     
@@ -421,7 +421,7 @@ import Foundation
         if self is KMTextImageButtonVC {
             KMDesignToken.shared.navMenuDesignToken(bgToken: bg, textToken: text, heightConstraint: height, control: self as! KMTextImageButtonVC, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMTextImageButtonVC 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMTextImageButtonVC 对象")
         }
     }
     
@@ -444,7 +444,7 @@ import Foundation
                 KMDesignToken.shared.buttonDesignToken(bgToken: bg, textToken: "", heightConstraint: NSLayoutConstraint(), control: self as! KMDesignButton, state: state)
             }
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
         }
     }
     
@@ -475,7 +475,7 @@ import Foundation
                 KMDesignToken.shared.buttonDesignToken(bgToken: bg, textToken: text, heightConstraint: imageHeight, control: self as! KMDesignButton, state: state)
             }
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignButton 对象")
         }
     }
     
@@ -485,7 +485,7 @@ import Foundation
         if self is KMDesignSelect {
             KMDesignToken.shared.selectDesignToken(bgToken: bg, textToken: text, textbgToken: textbg, heightConstraint: height, control: self as! KMDesignSelect, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignSelect 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignSelect 对象")
         }
     }
     
@@ -495,7 +495,7 @@ import Foundation
         if self is KMDesignPropertySelector {
             KMDesignToken.shared.propertySelectorDesignToken(bgToken: bg, textToken: text, itemSpacingToken: itemSpacing, textMainToken: textMain, textDescToken: textDesc, fillToken: fill, highlightToken: highlight, control: self as! KMDesignPropertySelector, state: state)
         } else {
-            print("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignPropertySelector 对象")
+            KMPrint("传入视图类型错误,组件库处理失败,本接口应传入 KMDesignPropertySelector 对象")
         }
     }
 }

+ 1 - 1
PDF Office/PDF Master/Class/Home/Tools/KMCloudDocumentTools.swift

@@ -34,7 +34,7 @@ class KMCloudDocumentTools: NSObject {
         }
         
         server.downloadCloudPath(file, localPath: URL(fileURLWithPath: localPath!)) { cloudFile, progress in
-            print(progress)
+            KMPrint(progress)
         } completion: { cloudFile, finished in
             callback(finished, URL(fileURLWithPath: localPath!))
         }

+ 4 - 4
PDF Office/PDF Master/Class/Home/ViewController/KMAIOpenPDFFilesVC.swift

@@ -106,7 +106,7 @@ class KMAIOpenPDFFilesVC: NSViewController {
 
             // 加载 PNG 图像
             guard let pngImage = NSImage(contentsOfFile: filePath) else {
-                print("Failed to load PNG image")
+                KMPrint("Failed to load PNG image")
                 return filePath
             }
 
@@ -117,7 +117,7 @@ class KMAIOpenPDFFilesVC: NSViewController {
 
             // 将 PNG 图像数据转换为 JPG 图像数据
             guard let jpgData = bitmap?.representation(using: .jpeg, properties: [:]) else {
-                print("Failed to convert PNG to JPG")
+                KMPrint("Failed to convert PNG to JPG")
                 return filePath
             }
 
@@ -125,10 +125,10 @@ class KMAIOpenPDFFilesVC: NSViewController {
             let fileURL = URL(fileURLWithPath: jpgPath)
             do {
                 try jpgData.write(to: fileURL)
-                print("JPG image saved successfully")
+                KMPrint("JPG image saved successfully")
                 return fileURL.path
             } catch {
-                print("Failed to save JPG image: \(error.localizedDescription)")
+                KMPrint("Failed to save JPG image: \(error.localizedDescription)")
                 return filePath
             }
         }

+ 3 - 3
PDF Office/PDF Master/Class/Home/ViewController/KMAITranslationVC.swift

@@ -258,9 +258,9 @@ class KMAITranslationVC: NSViewController {
         if FileManager.default.fileExists(atPath: destinationURL.path) {
             do {
                 try FileManager.default.removeItem(at: destinationURL)
-                print("删除旧文件成功")
+                KMPrint("删除旧文件成功")
             } catch {
-                print("删除旧文件失败:\(error)")
+                KMPrint("删除旧文件失败:\(error)")
             }
         }
         let sessionConfiguration = URLSessionConfiguration.default
@@ -403,7 +403,7 @@ class KMAITranslationVC: NSViewController {
                 return megabyteSize >= 10
             }
         } catch {
-            print("Error: \(error)")
+            KMPrint("Error: \(error)")
         }
 
         return false

+ 1 - 1
PDF Office/PDF Master/Class/Home/ViewController/KMHistoryFileCollectionViewItem.swift

@@ -145,6 +145,6 @@ class KMHistoryFileCollectionViewItem: NSCollectionViewItem {
     }
     
     @IBAction func favoriteButtonAction(_ sender: NSButton) {
-        print("收藏文件按钮")
+        KMPrint("收藏文件按钮")
     }
 }

+ 9 - 9
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -76,7 +76,7 @@ extension KMHomeViewController {
             cloudDocumentsButtonAction()
             break
         default:
-            print("error: 错误的传入枚举")
+            KMPrint("error: 错误的传入枚举")
             break
         }
     }
@@ -261,7 +261,7 @@ extension KMHomeViewController {
     }
     
     func favoriteDocumentsButtonAction() {
-        print("Favorite Documents")
+        KMPrint("Favorite Documents")
     }
     
     func cloudDocumentsButtonAction() {
@@ -529,7 +529,7 @@ extension KMHomeViewController {
 
             // 加载 PNG 图像
             guard let pngImage = NSImage(contentsOfFile: filePath) else {
-                print("Failed to load PNG image")
+                KMPrint("Failed to load PNG image")
                 return
             }
 
@@ -540,7 +540,7 @@ extension KMHomeViewController {
 
             // 将 PNG 图像数据转换为 JPG 图像数据
             guard let jpgData = bitmap?.representation(using: .jpeg, properties: [:]) else {
-                print("Failed to convert PNG to JPG")
+                KMPrint("Failed to convert PNG to JPG")
                 return
             }
 
@@ -549,9 +549,9 @@ extension KMHomeViewController {
             do {
                 try jpgData.write(to: fileURL)
                 filePath = fileURL.path
-                print("JPG image saved successfully")
+                KMPrint("JPG image saved successfully")
             } catch {
-                print("Failed to save JPG image: \(error.localizedDescription)")
+                KMPrint("Failed to save JPG image: \(error.localizedDescription)")
             }
         }
 
@@ -740,9 +740,9 @@ extension KMHomeViewController {
         if FileManager.default.fileExists(atPath: destinationURL.path) {
             do {
                 try FileManager.default.removeItem(at: destinationURL)
-                print("删除旧文件成功")
+                KMPrint("删除旧文件成功")
             } catch {
-                print("删除旧文件失败:\(error)")
+                KMPrint("删除旧文件失败:\(error)")
             }
         }
         let sessionConfiguration = URLSessionConfiguration.default
@@ -1061,7 +1061,7 @@ extension KMHomeViewController {
     }
     
     func fastTool_FileCompare() {   // 文件对比
-        print("选中 快捷工具 文件对比")
+        KMPrint("选中 快捷工具 文件对比")
     }
     
     func fastTool_PDFToPPT() {

+ 14 - 14
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -188,35 +188,35 @@ import KMAdvertisement
     
     func initNetworkingData() {
         KMAdvertisementManager.manager.fetchDataWithResponseObject { [unowned self] data, responseObject, error in
-            print("获取广告数据成功")
+            KMPrint("获取广告数据成功")
             if data != nil {
                 for model in data! {
                     guard let sectionContent = model.content else { break }
                     if model.showType == .list {
                         for section in sectionContent {
-                            print("list section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
+                            KMPrint("list section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
                             guard let itemContent = section.content else { break }
                             
                             for item in itemContent {
-                                print("item 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
-                                print("item 图片链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
-                                print("item 点击链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
-                                print("item tips" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
-                                print("item actionType" + String(Int(item.actionType.rawValue)))
+                                KMPrint("item 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
+                                KMPrint("item 图片链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
+                                KMPrint("item 点击链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
+                                KMPrint("item tips" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
+                                KMPrint("item actionType" + String(Int(item.actionType.rawValue)))
                             }
                         }
                     }
                     if model.showType == .view {
                         for section in sectionContent {
-                            print("view section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
+                            KMPrint("view section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
                             guard let itemContent = section.content else { break }
                             
                             for item in itemContent {
-                                print("item 标题 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
-                                print("item 图片链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
-                                print("item 点击链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
-                                print("item tips = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
-                                print("item actionType = " + String(Int(item.actionType.rawValue)))
+                                KMPrint("item 标题 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
+                                KMPrint("item 图片链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
+                                KMPrint("item 点击链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
+                                KMPrint("item tips = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
+                                KMPrint("item actionType = " + String(Int(item.actionType.rawValue)))
                             }
                         }
                     }
@@ -655,7 +655,7 @@ import KMAdvertisement
                 return megabyteSize >= 10
             }
         } catch {
-            print("Error: \(error)")
+            KMPrint("Error: \(error)")
         }
 
         return false

+ 2 - 2
PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationConfirmWindowController.swift

@@ -330,9 +330,9 @@ class KMAITranslationConfirmWindowController: NSWindowController {
         if FileManager.default.fileExists(atPath: self.saveFileUrl.path) {
             do {
                 try FileManager.default.removeItem(at: self.saveFileUrl)
-                print("删除旧文件成功")
+                KMPrint("删除旧文件成功")
             } catch {
-                print("删除旧文件失败:\(error)")
+                KMPrint("删除旧文件失败:\(error)")
             }
         }
         let sessionConfiguration = URLSessionConfiguration.default

+ 2 - 2
PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.swift

@@ -76,7 +76,7 @@ extension KMDeviceBrowserWindowController: IKDeviceBrowserViewDelegate {
     }
     
     func deviceBrowserView(_ deviceBrowserView: IKDeviceBrowserView!, didEncounterError error: Error!) {
-        print("111")
+        KMPrint("111")
     }
 }
 
@@ -88,7 +88,7 @@ extension KMDeviceBrowserWindowController: IKCameraDeviceViewDelegate {
 //                self.importCameraFileCallback(url);
 //            }
 //        }
-        print("获取图片完成")
+        KMPrint("获取图片完成")
     }
 }
 

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/Cache/KMLightMemberCache.swift

@@ -47,9 +47,9 @@ class KMLightMemberCache: NSObject {
         let success = saveData.write(toFile: string.expandingTildeInPath as String, atomically: true)
 
         if (success == true) {
-            print("成功 -" + (string.expandingTildeInPath as String))
+            KMPrint("成功 -" + (string.expandingTildeInPath as String))
         } else {
-            print("失败 -" + (string.expandingTildeInPath as String))
+            KMPrint("失败 -" + (string.expandingTildeInPath as String))
         }
     }
 

+ 5 - 5
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift

@@ -20,7 +20,7 @@ class KMAccountInfoWindowController: NSWindowController {
     var cancellAtionAction: KMAccountInfoWindowControllerCancellationAction?
     
     deinit {
-        print("KMAccountInfoWindowController 释放")
+        KMPrint("KMAccountInfoWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -85,7 +85,7 @@ class KMAccountInfoWindowController: NSWindowController {
         self.window?.contentView?.backgroundColor(NSColor(hex: "#FFFFFF"))
         
         self.accountInfoView.closeAction = { view in
-            print("关闭")
+            KMPrint("关闭")
             accountInfoMainWindow?.endSheet(view.window!)
             view.window?.close()
             accountInfoController = nil
@@ -93,10 +93,10 @@ class KMAccountInfoWindowController: NSWindowController {
         }
         
         self.accountInfoView.logOutAction = { view in
-            print("登出")
+            KMPrint("登出")
             KMRequestServerManager.manager.logout { success, result in
                 if success {
-                    print("登出成功")
+                    KMPrint("登出成功")
                 }
             }
             KMLightMemberManager.manager.logOut()
@@ -107,7 +107,7 @@ class KMAccountInfoWindowController: NSWindowController {
         }
         
         self.accountInfoView.cancellationAction = { [unowned self] view in
-            print("注销")
+            KMPrint("注销")
             
             if KMLightMemberManager.manager.purchaseState == .subscription ||
                 KMLightMemberManager.manager.purchaseState == .trial {

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/View/KMAccountInfoView.swift

@@ -210,7 +210,7 @@ class KMAccountInfoView: KMBaseXibView {
         let targetDateFormatter = DateFormatter()
         targetDateFormatter.dateFormat = "yyyy-MM-dd"
         let formattedDate = targetDateFormatter.string(from: date ?? NSDate() as Date)
-        print(formattedDate) // 输出:2024-06-28
+        KMPrint(formattedDate) // 输出:2024-06-28
         return formattedDate
     }
 }

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Cancellation/KMCancellationWindowController.swift

@@ -14,7 +14,7 @@ class KMCancellationWindowController: NSWindowController {
     @IBOutlet weak var cancellationSuccessView: KMCancellationSuccessView!
     
     deinit {
-        print("KMCancellationWindowController 释放")
+        KMPrint("KMCancellationWindowController 释放")
     }
     override func windowDidLoad() {
         super.windowDidLoad()

+ 7 - 7
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift

@@ -48,7 +48,7 @@ class KMComparativeTableViewController: NSWindowController {
     var restoreAction: KMComparativeTableViewControllerRestoreAction?
     
     deinit {
-        print("KMComparativeTableViewController 释放")
+        KMPrint("KMComparativeTableViewController 释放")
     }
     
     //MARK: 打开文件
@@ -121,13 +121,13 @@ class KMComparativeTableViewController: NSWindowController {
         // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
         self.setup()
         
-        print("订阅状态:  \(KMInAppPurchaseManager.manager.state)")
+        KMPrint("订阅状态:  \(KMInAppPurchaseManager.manager.state)")
     }
     
     func setup() {
         self.window?.contentView?.backgroundColor(NSColor(hex: "FFFFFF"))
         self.comparativeView.closeAction = { view in
-            print("关闭")
+            KMPrint("关闭")
             comparativeMainWindow?.endSheet(view.window!)
             view.window?.close()
             comparativeController = nil
@@ -135,7 +135,7 @@ class KMComparativeTableViewController: NSWindowController {
         }
         
         self.comparativeView.signUpAction = { [weak self] view in
-            print("注册")
+            KMPrint("注册")
             guard let callBack = self?.signUpAction else { return }
 
             callBack(self!)
@@ -149,14 +149,14 @@ class KMComparativeTableViewController: NSWindowController {
 //        }
 //
         self.comparativeView.subscriptionAction = { [weak self] view in
-            print("订阅")
+            KMPrint("订阅")
             guard let callBack = self?.subscriptionAction else { return }
 
             callBack(self!)
         }
 
         self.comparativeView.restoreAction = { [weak self] view in
-            print("restore订阅")
+            KMPrint("restore订阅")
             guard let callBack = self?.restoreAction else { return }
 
             callBack(self!)
@@ -193,7 +193,7 @@ class KMComparativeTableViewController: NSWindowController {
             } else {
                 KMPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1) { isSuccess, error in
                     if isSuccess {
-                        print("订阅成功")
+                        KMPrint("订阅成功")
                         comparativeController = nil
                         comparativeMainWindow?.endSheet(controller.window!)
                         comparativeMainWindow = nil

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/KMComparativeOutlineView.swift

@@ -34,7 +34,7 @@ class KMComparativeOutlineView: KMBaseXibView {
     override func reloadData() {
         super.reloadData()
         KMComparativeManager.manager.fetchData { [unowned self] result in
-            print(result)
+            KMPrint(result)
             if result != nil {
                 self.data = result
                 self.outlineView.reloadData()

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/ComparativeView/Manager/KMComparativeManager.swift

@@ -24,7 +24,7 @@ class KMComparativeManager: NSObject {
         var dictionary = NSDictionary(contentsOfFile: filePath)
         
         if(!JSONSerialization.isValidJSONObject(dictionary as Any)) {
-            print("无法解析出JSONString")
+            KMPrint("无法解析出JSONString")
             return
         }
         let data : NSData! = try? JSONSerialization.data(withJSONObject: dictionary as Any, options: []) as NSData?

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift

@@ -176,7 +176,7 @@ extension KMComparativeView: NSCollectionViewDataSource {
 extension KMComparativeView: NSCollectionViewDelegate {
     //当item被选中
     public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
-        print("点击")
+        KMPrint("点击")
     }
     
    //当item取消选中
@@ -222,7 +222,7 @@ extension KMComparativeView: NSTextViewDelegate {
         if link as! String == "register://" {
 //            guard let callBack = self.subscribeAction else { return true }
             
-            print("链接点击")
+            KMPrint("链接点击")
 //            callBack(self)
         }
         return true

+ 6 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.swift

@@ -115,11 +115,11 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
             let describe = NSLocalizedString(data["describe"] as? String ?? "", comment: "")
             
             if product.productIdentifier == productId {
-                print("-----------------------------")
-                print(product.priceLocale.currencyCode)
-                print(product.introductoryPrice?.price)
-                print(product.price)
-                print("-----------------------------")
+                KMPrint("-----------------------------")
+                KMPrint(product.priceLocale.currencyCode)
+                KMPrint(product.introductoryPrice?.price)
+                KMPrint(product.price)
+                KMPrint("-----------------------------")
                 let currencyCode: String = product.priceLocale.currencyCode ?? "$"
                 let price: String = product.introductoryPrice?.price.description ?? "39.9"
                 let originPrice: String = product.price.description
@@ -160,7 +160,7 @@ extension KMComparativeViewCollectionItem: NSCollectionViewDataSource {
 extension KMComparativeViewCollectionItem: NSCollectionViewDelegate {
     //当item被选中
     public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
-        print("点击")
+        KMPrint("点击")
     }
     
    //当item取消选中

+ 5 - 5
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift

@@ -41,7 +41,7 @@ class KMLoginWindowController: NSWindowController {
     }
     
     deinit {
-        print("KMLoginWindowController 释放")
+        KMPrint("KMLoginWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -81,10 +81,10 @@ class KMLoginWindowController: NSWindowController {
         self.window?.contentView?.backgroundColor(NSColor(hex: "#FFFFFF"))
         KMRequestServer.requestServer.reachabilityStatusChange { [weak self] status in
             if status == .notReachable {
-                print("无网络")
+                KMPrint("无网络")
                 self?.noNetworkView.isHidden = false
             } else {
-                print("有网络")
+                KMPrint("有网络")
                 self?.noNetworkView.isHidden = true
             }
         }
@@ -151,7 +151,7 @@ class KMLoginWindowController: NSWindowController {
         //注册成功界面点击完成按钮
         self.registerSuccessView.doneAction = { [unowned self] view in
             self.closeWindow()
-            print("注册成功")
+            KMPrint("注册成功")
             //跳转订阅比较表
             let _ = KMComparativeTableViewController.show(window: NSApp.mainWindow ?? NSWindow())
         }
@@ -159,7 +159,7 @@ class KMLoginWindowController: NSWindowController {
         self.registerSuccessView.subscribeAction = { [unowned self] view in
             self.closeWindow()
             KMComparativeTableViewController.show(window: NSApp.mainWindow ?? NSWindow())
-            print("注册成功")
+            KMPrint("注册成功")
         }
         
         //MARK: - 验证码界面

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginInputPasswordView.swift

@@ -231,7 +231,7 @@ extension KMLoginInputPasswordView: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if (textView.string == self.model.password) {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     
                     if self.model.canNext {
                         self.loginButtonAction(self.loginButton)
@@ -250,7 +250,7 @@ extension KMLoginInputPasswordView: NSTextViewDelegate {
         if link as! String == "changeEmail://" {
             guard let callBack = self.changeEmailAction else { return true }
 
-            print("链接点击")
+            KMPrint("链接点击")
             callBack(self)
         }
         return true

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.swift

@@ -75,7 +75,7 @@ class KMLoginLeftImageView: KMBaseXibView {
     }
     
     @IBAction func cancelButtonAction(_ sender: Any) {
-        print("关闭")
+        KMPrint("关闭")
         if self.cancelAction != nil {
             self.cancelAction!(self)
         }

+ 3 - 3
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginView.swift

@@ -125,7 +125,7 @@ extension KMLoginView: NSTextViewDelegate {
         if link as! String == "register://" {
             guard let callBack = self.registerAction else { return true }
             
-            print("链接点击")
+            KMPrint("链接点击")
             callBack(self, self.model)
         }
         return true
@@ -134,7 +134,7 @@ extension KMLoginView: NSTextViewDelegate {
 
 extension KMLoginView: NSTextFieldDelegate {
     func controlTextDidEndEditing(_ obj: Notification) {
-        print("controlTextDidEndEditing")
+        KMPrint("controlTextDidEndEditing")
         let textField = obj.object as? NSTextField
         if (textField == self.emailTextField) {
             self.emainDidEndEditing()
@@ -157,7 +157,7 @@ extension KMLoginView: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if inputView == self.emailTextField {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     
                     if KMLoginView.verificationEmail(self.emailTextField.stringValue) {
                         self.nextButtonAction(self.nextButton)

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMRegisterSuccessView.swift

@@ -121,7 +121,7 @@ extension KMRegisterSuccessView: NSTextViewDelegate {
         if link as! String == "register://" {
             guard let callBack = self.subscribeAction else { return true }
             
-            print("链接点击")
+            KMPrint("链接点击")
             callBack(self)
         }
         return true

+ 6 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMRegisterView.swift

@@ -214,7 +214,7 @@ class KMRegisterView: KMBaseXibView {
 
 extension KMRegisterView: NSTextFieldDelegate {
     func controlTextDidEndEditing(_ obj: Notification) {
-        print("controlTextDidEndEditing")
+        KMPrint("controlTextDidEndEditing")
         let textField = obj.object as? NSTextField
         if (textField == self.emailTextField) {
             self.presenter.changeEmail(string: self.emailTextField.stringValue)
@@ -257,7 +257,7 @@ extension KMRegisterView: NSTextFieldDelegate {
                 if (textView.string == self.emailTextField.stringValue ||
                     textView.string == self.passwordTextField.stringValue ||
                     textView.string == self.passwordSecureTextField.stringValue) {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     
                     if self.model.canNext {
                         self.nextButtonAction(self.nextButton)
@@ -276,13 +276,13 @@ extension KMRegisterView: NSTextViewDelegate {
         if link as! String == "login://" {
             guard let callBack = self.loginAction else { return true }
 
-            print("链接点击")
+            KMPrint("链接点击")
             callBack(self, self.model)
         } else if link as! String == "privacy://" {
-            print("privacy点击")
+            KMPrint("privacy点击")
             NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/privacy-policy")!)
         } else if link as! String == "license://" {
-            print("license点击")
+            KMPrint("license点击")
             NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/terms_of_service")!)
         }
         return true
@@ -294,7 +294,7 @@ protocol KMRegisterViewAction {}
 extension KMRegisterView: KMRegisterViewAction {
     @IBAction func nextButtonAction(_ sender: NSButton) {
         guard let callBack = self.nextAction else { return }
-        print("KMRegisterView 下一步")
+        KMPrint("KMRegisterView 下一步")
 
         self.changeNextButtonState(enable: false)
         callBack(self, self.model, sender)

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMResetPasswordView.swift

@@ -283,7 +283,7 @@ extension KMResetPasswordView: NSTextFieldDelegate {
                     textView.string == self.passwordSecureTextField.stringValue ||
                     textView.string == self.rePasswordTextField.stringValue ||
                     textView.string == self.rePasswordSecureTextField.stringValue) {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     
                     if self.model.canNext {
                         self.doneButtonAction(self.doneButton)

+ 1 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/SubscribeSuccess/KMSubscribeSuccessWindowController.swift

@@ -17,7 +17,7 @@ class KMSubscribeSuccessWindowController: NSWindowController {
     var closeAction: KMSubscribeSuccessWindowControllerCloseAction?
     
     deinit {
-        print("KMSubscribeSuccessWindowController 释放")
+        KMPrint("KMSubscribeSuccessWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -33,7 +33,6 @@ class KMSubscribeSuccessWindowController: NSWindowController {
         subscribeSuccessWindowController.window?.center()
         
         subscribeSuccessWindowController.closeAction = { controller in
-            print("关闭")
             controller.closeWindow()
         }
         

+ 7 - 9
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift

@@ -25,7 +25,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
     var restoreAction: KMSubscribeWaterMarkWindowControllerRestoreAction?
     
     deinit {
-        print("KMSubscribeWaterMarkWindowController 释放")
+        KMPrint("KMSubscribeWaterMarkWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -42,7 +42,6 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         subscribeWaterMarkWindowController.window?.center()
         
         subscribeWaterMarkWindowController.closeAction = { controller in
-            print("关闭")
             completion(false, false, true)
             subscribeWaterMarkMainWindow?.endSheet(controller.window!)
             controller.window?.close()
@@ -52,7 +51,6 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         }
         
         subscribeWaterMarkWindowController.watermarkExportAction = { controller in
-            print("关闭")
             completion(false, true, false)
             subscribeWaterMarkMainWindow?.endSheet(controller.window!)
             controller.window?.close()
@@ -61,11 +59,11 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         }
         
         subscribeWaterMarkWindowController.subscribeAction = { controller in
-            print("购买")
+            KMPrint("购买")
             controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
             KMPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1) { isSuccess, error in
                 if isSuccess {
-                    print("购买成功")
+                    KMPrint("购买成功")
                     subscribeWaterMarkMainWindow?.endSheet(controller.window!)
                     controller.window?.close()
                     subscribeWaterMarkController = nil
@@ -81,7 +79,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                         }
                     }
                 } else {
-                    print("购买失败")
+                    KMPrint("购买失败")
                     controller.purchasefailed()
                     completion(false, false, false)
                 }
@@ -91,11 +89,11 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         }
         
         subscribeWaterMarkWindowController.restoreAction = { controller in
-            print("restore")
+            KMPrint("restore")
             controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
             KMPurchaseManager.manager.restorePurchases { isSuccess in
                 if isSuccess {
-                    print("restore成功")
+                    KMPrint("restore成功")
                     subscribeWaterMarkMainWindow?.endSheet(controller.window!)
                     controller.window?.close()
                     subscribeWaterMarkController = nil
@@ -109,7 +107,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                         }
                     }
                 } else {
-                    print("restore失败")
+                    KMPrint("restore失败")
                     controller.purchasefailed()
                     completion(false, false, false)
                 }

+ 5 - 5
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift

@@ -136,11 +136,11 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
         let productId: String = PRODUCT_1
         for product in KMInAppPurchaseManager.manager.availableProducts {
             if product.productIdentifier == productId {
-                print("-----------------------------")
-                print(product.priceLocale.currencyCode)
-                print(product.introductoryPrice?.price)
-                print(product.price)
-                print("-----------------------------")
+                KMPrint("-----------------------------")
+                KMPrint(product.priceLocale.currencyCode)
+                KMPrint(product.introductoryPrice?.price)
+                KMPrint(product.price)
+                KMPrint("-----------------------------")
                 let currencyCode: String = product.priceLocale.currencyCode ?? "$"
                 let price: String = product.introductoryPrice?.price.description ?? "39.9"
                 let originPrice: String = product.price.description ?? "79.9"

+ 6 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/KMVerficationCodeWindowController.swift

@@ -20,7 +20,7 @@ class KMVerficationCodeWindowController: NSWindowController {
     var inputType: DataNavigationViewButtonActionType?
     
     deinit {
-        print("KMVerficationCodeWindowController 释放")
+        KMPrint("KMVerficationCodeWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -48,7 +48,7 @@ class KMVerficationCodeWindowController: NSWindowController {
         self.window?.contentView?.backgroundColor(NSColor(hex: "#FFFFFF"))
         
         self.verificationCodeView.closeAction = { view in
-            print("关闭")
+            KMPrint("关闭")
             verficationCodeMainWindow?.endSheet(view.window!)
             view.window?.close()
             verficationCodeController = nil
@@ -56,7 +56,7 @@ class KMVerficationCodeWindowController: NSWindowController {
         }
         
         self.verificationCodeView.cancelAction = { view in
-            print("登出")
+            KMPrint("登出")
             verficationCodeMainWindow?.endSheet(view.window!)
             view.window?.close()
             verficationCodeController = nil
@@ -64,7 +64,7 @@ class KMVerficationCodeWindowController: NSWindowController {
         }
         
         self.verificationCodeView.doneAction = { [unowned self] (view, data , sender) in
-            print("注销")
+            KMPrint("注销")
             KMRequestServerManager.manager.logOff(verifyCode: data.verifyCode, complete: { [weak self] success, result in
                 if self?.verificationCodeView != nil {
                     if success {
@@ -100,10 +100,10 @@ class KMVerficationCodeWindowController: NSWindowController {
         
         KMRequestServer.requestServer.reachabilityStatusChange { [weak self] status in
             if status == .notReachable {
-                print("无网络")
+                KMPrint("无网络")
                 self?.networkView.isHidden = false
             } else {
-                print("有网络")
+                KMPrint("有网络")
                 self?.networkView.isHidden = true
             }
         }

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift

@@ -76,7 +76,7 @@ class KMVerificationCodeView: KMBaseXibView {
             case .accountInfo:
                 self.verifyCodeType = .logOff
             default:
-                print("")
+                KMPrint("")
             }
             
             self.cleanVerificationCode()
@@ -98,7 +98,7 @@ class KMVerificationCodeView: KMBaseXibView {
     
     deinit {
         self.endTimer()
-        print("KMVerificationCodeView dealloc")
+        KMPrint("KMVerificationCodeView dealloc")
     }
     
     override func draw(_ dirtyRect: NSRect) {
@@ -449,7 +449,7 @@ extension KMVerificationCodeView: NSTextViewDelegate {
 
 extension KMVerificationCodeView: NSTextFieldDelegate {
     func controlTextDidEndEditing(_ obj: Notification) {
-        print("controlTextDidEndEditing")
+        KMPrint("controlTextDidEndEditing")
         let textField = obj.object as? NSTextField
         for view in self.textFieldContentView.subviews {
             let t = view.subviews.first as? FocusAwareTextField
@@ -468,7 +468,7 @@ extension KMVerificationCodeView {
     override func performKeyEquivalent(with event: NSEvent) -> Bool {
         if event.type == .keyDown, event.modifierFlags.contains(.command), event.characters == "v" {
             if let pasteboardString = NSPasteboard.general.string(forType: .string) {
-                print(pasteboardString)
+                KMPrint(pasteboardString)
                 if let num = Int(pasteboardString) {
                     let textFieldArray = [self.code1TextField,self.code2TextField,self.code3TextField,self.code4TextField,self.code5TextField,self.code6TextField]
                     for index in 0...textFieldArray.count - 1 {

+ 20 - 20
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift

@@ -104,7 +104,7 @@ class KMInAppPurchaseManager: NSObject {
         self.orderId = orderId
         if SKPaymentQueue.canMakePayments() {
             if let product = availableProducts.first(where: { $0.productIdentifier == productIdentifier }) {
-                print("\("购买产品") + \(productIdentifier)")
+                KMPrint("\("购买产品") + \(productIdentifier)")
                 let payment = SKMutablePayment(product: product)
                 payment.applicationUsername = orderId
                 SKPaymentQueue.default().add(payment)
@@ -137,7 +137,7 @@ class KMInAppPurchaseManager: NSObject {
     //MARK: 购买返回类型
     func handleAction(state: KMInAppPurchaseState) {
 #if DEBUG
-        print(state.rawValue)
+        KMPrint(state.rawValue)
 #endif
         DispatchQueue.main.async { [unowned self] in
             if state == .verSuccess {
@@ -161,17 +161,17 @@ class KMInAppPurchaseManager: NSObject {
 extension KMInAppPurchaseManager: SKProductsRequestDelegate {
     func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
         availableProducts = response.products
-        print(availableProducts)
+        KMPrint(availableProducts)
 #if DEBUG
-        print(response.invalidProductIdentifiers)
-        print("产品付费数量")
-        print(response.products.count)
+        KMPrint(response.invalidProductIdentifiers)
+        KMPrint("产品付费数量")
+        KMPrint(response.products.count)
         for p in response.products {
-            print(p.description)
-            print(p.localizedTitle)
-            print(p.localizedDescription)
-            print(p.price);
-            print(p.productIdentifier)
+            KMPrint(p.description)
+            KMPrint(p.localizedTitle)
+            KMPrint(p.localizedDescription)
+            KMPrint(p.price);
+            KMPrint(p.productIdentifier)
         }
 #endif
 
@@ -187,7 +187,7 @@ extension KMInAppPurchaseManager: SKProductsRequestDelegate {
     
     func request(_ request: SKRequest, didFailWithError error: Error) {
         // 处理请求错误
-        print("\("用户无法进行内购") + \(error)")
+        KMPrint("\("用户无法进行内购") + \(error)")
         self.handleAction(state: .notArrow)
     }
 }
@@ -200,7 +200,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
     }
     
     func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
-        print("服务器返回数据")
+        KMPrint("服务器返回数据")
         let hasPurchased = false
         let hasFailed = false
         if transactions.count > 0 {
@@ -209,16 +209,16 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
             switch transaction.transactionState {
             case .purchased:
                 // 购买成功,进行本地二次验证
-                print("购买成功,进行本地二次验证")
+                KMPrint("购买成功,进行本地二次验证")
 //                self.handleAction(state: .success)
                 validatePurchase(transaction: transaction)
             case .failed:
                 // 购买失败,处理错误
-                print("购买失败,处理错误")
+                KMPrint("购买失败,处理错误")
                 handleError(transaction: transaction)
             case .restored:
                 // 恢复购买,进行本地二次验证
-                print("恢复购买,进行本地二次验证")
+                KMPrint("恢复购买,进行本地二次验证")
 //                self.handleAction(state: .restoreSuccess)
                 validatePurchase(transaction: transaction)
             default:
@@ -254,7 +254,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
         // 构建请求
         let receiptString = receiptData.base64EncodedString(options: [])
         let tempOrderId = self.orderId ?? ""
-        print(receiptString)
+        KMPrint(receiptString)
         if transaction.transactionState == .restored {
             KMRequestServerManager.manager.parseVerification(applePayProductId: PRODUCT_1, orderId: tempOrderId, receipt: receiptString, restore: 1) { [unowned self] success, result in
                 if success, let data = result?.result {
@@ -331,7 +331,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
     }
 
     func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {
-        print("paymentQueueRestoreCompletedTransactionsFinished")
+        KMPrint("paymentQueueRestoreCompletedTransactionsFinished")
     }
     
     func parseVerificationResult(data: Data) -> Bool {
@@ -339,7 +339,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
         // 如果验证成功返回 true,否则返回 false
         // ...
         let receipt: [String: Any] = self.parseReceipt(receiptData: data) ?? [:]
-        print(receipt)
+        KMPrint(receipt)
         let status: Int = receipt["status"] as! Int
         if status == 21007 {
             self.handleAction(state: .verFailed)
@@ -366,7 +366,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
         // 如果验证成功返回 true,否则返回 false
         // ...
         let receipt: [String: Any] = self.parseReceipt(receiptData: data) ?? [:]
-        print(receipt)
+        KMPrint(receipt)
         let status: Int = receipt["status"] as! Int
         if status == 21007 {
             self.handleAction(state: .verFailed)

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/DMG/KMDMGPurchaseManager.swift

@@ -26,13 +26,13 @@ class KMDMGPurchaseManager: NSObject {
     func restorePurchases() {
         KMRequestServerManager.manager.getUserInfo { [unowned self] success, data, error, isLocal in
             if success {
-                print("DMG刷新用户信息成功")
+                KMPrint("DMG刷新用户信息成功")
                 if KMLightMemberManager.manager.purchaseState == .subscription {
                     let controller = KMSubscribeWaterMarkWindowController.isSampleController()
                     controller.closeWindow()
                 }
             } else {
-                print("DMG刷新用户信息失败")
+                KMPrint("DMG刷新用户信息失败")
             }
         }
     }

+ 13 - 31
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/KMPurchaseManager.swift

@@ -54,48 +54,30 @@ class KMPurchaseManager: NSObject {
             }
             return tempState
         }
-//#if VERSION_FREE
-//            return KMInAppPurchaseManager.manager.state
-//#endif
-//
-//#if VERSION_DMG
-//        print("获取产品状态")
-//            return .unknow
-//#endif
-//        }
     }
     var availableProducts: [KMProduct] = []
     
     override init() {
         super.init()
-        
-//        self.fetchProducts { isSuccess, products, error in
-//            if isSuccess {
-//                print("获取产品成功")
-//            } else {
-//                print("获取产品失败")
-//            }
-//            print(products)
-//        }
     }
     
     func fetchProducts(completeion: @escaping KMPurchaseFetchProductCompletion) {
-        print("获取产品中")
+        KMPrint("获取产品中")
 #if VERSION_FREE
-        print("正在获取产品中AppStore")
+        KMPrint("正在获取产品中AppStore")
         KMInAppPurchaseManager.manager.fetchProducts(completion: completeion)
 #endif
         
 #if VERSION_DMG
-        print("正在获取产品中DMG")
+        KMPrint("正在获取产品中DMG")
         KMDMGPurchaseManager.manager.fetchProducts(completion: completeion)
 #endif
     }
     
     func purchaseProduct(productIdentifier: String, completion: @escaping KMPurchaseCompletion) {
-        print("准备订阅中")
+        KMPrint("准备订阅中")
 #if VERSION_FREE
-        print("正在订阅中AppStore")
+        KMPrint("正在订阅中AppStore")
         
         let userId: String = KMLightMemberManager.manager.info.id
         KMRequestServerManager.manager.createOrder(productId: "21", userId: userId) { success, orderId, result in
@@ -103,10 +85,10 @@ class KMPurchaseManager: NSObject {
                 if orderId?.count != 0 {
                     KMInAppPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1, orderId: orderId!) { isSuccess, error in
                         if isSuccess {
-                            print("购买成功")
+                            KMPrint("购买成功")
                             completion(true, error)
                         } else {
-                            print("购买失败")
+                            KMPrint("购买失败")
                             completion(false, error)
                         }
                     }
@@ -116,25 +98,25 @@ class KMPurchaseManager: NSObject {
 #endif
         
 #if VERSION_DMG
-        print("正在订阅中DMG")
+        KMPrint("正在订阅中DMG")
         KMDMGPurchaseManager.manager.purchaseProduct(productIdentifier: productIdentifier, email: "350846486@qq.com", completion: completion)
 #endif
     }
     
     func restorePurchases(_ completion: @escaping KMPurchaseRestoreCompletion) {
-        print("准备restore")
+        KMPrint("准备restore")
 #if VERSION_FREE
-        print("正在restore")
+        KMPrint("正在restore")
         let userId: String = KMLightMemberManager.manager.info.id
         KMRequestServerManager.manager.restore(productId: "21", userId: userId) { success, orderId, result in
             if success {
                 if orderId?.count != 0 {
                     KMInAppPurchaseManager.manager.restorePurchases(orderId!) { isSuccess in
                         if isSuccess {
-                            print("购买成功")
+                            KMPrint("购买成功")
                             completion(true)
                         } else {
-                            print("购买失败")
+                            KMPrint("购买失败")
                             completion(false)
                         }
                     }
@@ -145,7 +127,7 @@ class KMPurchaseManager: NSObject {
         
 #if VERSION_DMG
         KMDMGPurchaseManager.manager.restorePurchases()
-        print("正在restore DMG")
+        KMPrint("正在restore DMG")
 #endif
     }
 }

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Manager/KMLightMemberManager.swift

@@ -185,7 +185,7 @@ extension KMLightMemberManager {
         if needNetworking {
             tokenValid = await self.isTokenValid()
         }
-        print(tokenValid)
+        KMPrint(tokenValid)
         if tokenValid && info.isInFreeUseTime {
             result = true
         }

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Manager/KMRequestServerManager.swift

@@ -504,7 +504,7 @@ extension KMRequestServerManager {
                                      "orderId": orderId,
                                      "receipt": receipt,
                                      "restore": restore]
-        print("二次验证上传数据:\(params)")
+        KMPrint("二次验证上传数据:\(params)")
         let token: String = KMLightMemberManager.manager.token.access_token
         if token == "" {
             complete(false, Result())
@@ -647,7 +647,7 @@ extension KMRequestServerManager {
 //            }
 //        }
         
-        print(dic)
+        KMPrint(dic)
         return Result(result: result,message: message,code: code, error: error)
     }
 }
@@ -723,7 +723,7 @@ extension KMRequestServerManager {
 
         let task = URLSession.shared.dataTask(with: request) { data, response, error in
            guard let data = data else {
-              print(String(describing: error))
+               KMPrint(String(describing: error))
               semaphore.signal()
               return
            }
@@ -790,7 +790,7 @@ extension KMRequestServerManager {
 
         let task = URLSession.shared.dataTask(with: request) { data, response, error in
            guard let data = data else {
-              print(String(describing: error))
+               KMPrint(String(describing: error))
               semaphore.signal()
               return
            }

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Model/KMLightMemberToken.swift

@@ -58,7 +58,7 @@ public class DictionaryToJson: NSObject {
                 jsonData = try JSONSerialization.data(withJSONObject: dic, options: .prettyPrinted)
             }
         } catch let parseError {
-            print("(parseError.localizedDescription)")
+            KMPrint("(parseError.localizedDescription)")
         }
         if let jsonData = jsonData {
             return String(data: jsonData, encoding: .utf8)

+ 1 - 1
PDF Office/PDF Master/Class/Merge/Controller/KMMergeViewController.swift

@@ -975,7 +975,7 @@ class KMMergeViewController: NSViewController {
 
 extension KMMergeViewController: KMMergeTitleBarDelegate {
     func titleBar(titleBar: KMMergeTitleBar, itemDidClick: KMMergeTitleBarButtonID) {
-        print();
+        KMPrint();
     }
 }
 

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Background/tool/KMBackgroundManager.swift

@@ -314,7 +314,7 @@ class KMBackgroundManager: NSObject {
                 dict["imagePath"] = path?.lastPathComponent
             }
             catch {
-                print("Failed to write to disk.")
+                KMPrint("Failed to write to disk.")
                 return [:]
             }
         }

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/Batch/KMBatchWindowController.swift

@@ -50,7 +50,7 @@ class KMBatchWindowController: NSWindowController {
     }
     
     deinit {
-        print("KMImageToPDFWindowController 释放")
+        KMPrint("KMImageToPDFWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -86,7 +86,7 @@ class KMBatchWindowController: NSWindowController {
     //MARK: 打开文件
     static func openFiles(window: NSWindow) {
         if KMBatchWindowController.isSampleController() {
-            print("存在相同文件")
+            KMPrint("存在相同文件")
             if let controller: KMBatchWindowController = self.fetchSampleController() {
                 controller.inputType = .Batch
                 controller.showWindow(window)
@@ -113,7 +113,7 @@ class KMBatchWindowController: NSWindowController {
     static func openFile(_ url: URL?, _ type: DataNavigationViewButtonActionType, _ subType: Any = "") {
         if KMBatchWindowController.isSampleController() {
             if let controller: KMBatchWindowController = self.fetchSampleController() {
-                print("存在相同文件")
+                KMPrint("存在相同文件")
                 controller.inputSubType = subType
                 controller.inputType = type
                 controller.showWindow(NSApp.mainWindow)
@@ -161,7 +161,7 @@ extension KMBatchWindowController: KMBatchProcessingViewDelegate {
 
 extension KMBatchWindowController: KMBatchCollectionViewDelegate {
     func didSelect(index: IndexPath, data: KMBatchCollectionViewModel) {
-        print(data.type.rawValue)
+        KMPrint(data.type.rawValue)
         let dataType: KMBatchCollectionViewType = data.type
         self.settingView.type = dataType
         

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Batch/View/Choose/ConvertPDF/KMBatchConvertPDFView.swift

@@ -120,7 +120,7 @@ class KMBatchConvertPDFView: KMBatchSettingItemView {
                 view = KMBatchConverPDFPPTView.init(frame: self.itemContentView.bounds)
                 break
             default:
-                print("找不到")
+                KMPrint("找不到")
                 break
             }
             view.type = type

+ 14 - 14
PDF Office/PDF Master/Class/PDFTools/Batch/View/Choose/KMBatchSettingView.swift

@@ -126,7 +126,7 @@ class KMBatchSettingView: KMBaseXibView {
                 }
                 break
             default:
-                print("找不到")
+                KMPrint("找不到")
                 break
             }
             resultView.type = type
@@ -216,7 +216,7 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                             case .allTable:
                                 convert.extractTableIndex = 2
                             default:
-                                print("未找到")
+                                KMPrint("未找到")
                             }
                         }
                     case .ppt:
@@ -233,7 +233,7 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                             case .allTable:
                                 convert.extractTableIndex = 2
                             default:
-                                print("未找到")
+                                KMPrint("未找到")
                             }
                         } else {
                             convert.isExtractTable = false
@@ -245,7 +245,7 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                     case .rtf:
                         convertType = .rtf
                     default:
-                        print("不清楚")
+                        KMPrint("不清楚")
                     }
                     convert.convertType = convertType
                     
@@ -405,9 +405,9 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                         
                     let result = docuemt!.write(to: URL(fileURLWithPath: path), withOptions: options)
                     if result {
-                        print("成功")
+                        KMPrint("成功")
                     } else {
-                        print("失败")
+                        KMPrint("失败")
                     }
                     NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: outputFolderPath)])
                 }
@@ -557,9 +557,9 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                         let result = document!.write(to: URL(fileURLWithPath: path))
                         
                         if (result) {
-                            print("backgroundFile成功")
+                            KMPrint("backgroundFile成功")
                         } else {
-                            print("backgroundFile失败")
+                            KMPrint("backgroundFile失败")
                         }
                     }
                     NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: outputFolderPath)])
@@ -683,9 +683,9 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                         
                         let result = document!.write(to: URL(fileURLWithPath: path))
                         if (result) {
-                            print("headAndFooterFile成功")
+                            KMPrint("headAndFooterFile成功")
                         } else {
-                            print("headAndFooterFile失败")
+                            KMPrint("headAndFooterFile失败")
                         }
                     }
                 }
@@ -813,9 +813,9 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                         
                         let result = document!.write(to: URL(fileURLWithPath: path))
                         if (result) {
-                            print("batesFile成功")
+                            KMPrint("batesFile成功")
                         } else {
-                            print("batesFile失败")
+                            KMPrint("batesFile失败")
                         }
                     }
                 }
@@ -900,9 +900,9 @@ extension KMBatchSettingView: KMBatchSettingViewExport {
                         
                         let result = document!.write(to: URL(fileURLWithPath: path))
                         if (result) {
-                            print("removeFile成功")
+                            KMPrint("removeFile成功")
                         } else {
-                            print("removeFile失败")
+                            KMPrint("removeFile失败")
                         }
                         NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: outputFolderPath)])
                     }

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift

@@ -503,7 +503,7 @@ class KMConvertBaseWindowController: KMBaseWindowController {
         if (pageIndexs != nil) {
             for i in pageIndexs! {
                 
-                print(i)
+                KMPrint(i)
             }
         }
         #endif

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/KMImageToPDFWindowController.swift

@@ -28,7 +28,7 @@ class KMImageToPDFWindowController: NSWindowController {
     }
     
     deinit {
-        print("KMImageToPDFWindowController 释放")
+        KMPrint("KMImageToPDFWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -82,7 +82,7 @@ class KMImageToPDFWindowController: NSWindowController {
     //MARK: 打开文件
     static func openFiles(window: NSWindow) {
         if KMImageToPDFWindowController.isSampleController() {
-            print("存在相同文件")
+            KMPrint("存在相同文件")
             if let controller: KMImageToPDFWindowController = self.fetchSampleController() {
                 controller.inputType = .ImageToPDF
                 controller.showWindow(window)
@@ -177,13 +177,13 @@ extension KMImageToPDFWindowController: KMImageToPDFWindowControllerAction {
 
 extension KMImageToPDFWindowController: KMImageToPDFChooseViewDelegate {
     func exportAction(data: KMImageToPDFChooseModel) {
-        print("导出")
+        KMPrint("导出")
         self.chooseData = data
         
         if self.batchData != nil {
             self.chooseData?.imageFilePaths = self.batchData
             KMImageToPDFManager.manager.exportPDF(model: self.chooseData!) { success, savePath, errors, OCRerrors in
-                print(success)
+                KMPrint(success)
                 if success {
                     NSWorkspace.shared.selectFile(savePath, inFileViewerRootedAtPath: "");
                 }  else {

+ 9 - 9
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/Manager/KMImageToPDFManager.swift

@@ -59,7 +59,7 @@ class KMImageToPDFManager: NSObject {
             
             if (options!.contains(.OCR)) {
                 //TODO: OCR部分待SDK提供
-                print("OCR 暂未实现")
+                KMPrint("OCR 暂未实现")
             } else if (options!.contains(.PDF)) {
                 if (exportPDFType == .new) {
                     self.creatPDF(model: self.model!, completion: completion)
@@ -95,7 +95,7 @@ class KMImageToPDFManager: NSObject {
             
             for imageFilePath in model.imageFilePaths! {
                 let success = creatPDFConversion(filePath: imageFilePath.filePath, savePath: savePath!)
-                print(success)
+                KMPrint(success)
                 if success == false {
                     imageFilePath.state = .error
                     self.errors.append(imageFilePath.filePath)
@@ -144,7 +144,7 @@ class KMImageToPDFManager: NSObject {
         if image != nil {
             let insertPageSuccess = document?.insertPage(image!.size, withImage: jpgPath, at: document!.pageCount)
             if insertPageSuccess != nil {
-                print("插入成功")
+                KMPrint("插入成功")
                 //信号量控制异步
                 let semaphore = DispatchSemaphore(value: 0)
                 DispatchQueue.global().async {
@@ -153,10 +153,10 @@ class KMImageToPDFManager: NSObject {
                 }
                 semaphore.wait()
             } else {
-                print("插入失败")
+                KMPrint("插入失败")
             }
         } else {
-            print("插入失败")
+            KMPrint("插入失败")
         }
         return success
     }
@@ -285,7 +285,7 @@ class KMImageToPDFManager: NSObject {
 
             // 加载 PNG 图像
             guard let pngImage = NSImage(contentsOfFile: filePath) else {
-                print("Failed to load PNG image")
+                KMPrint("Failed to load PNG image")
                 return filePath
             }
 
@@ -296,7 +296,7 @@ class KMImageToPDFManager: NSObject {
 
             // 将 PNG 图像数据转换为 JPG 图像数据
             guard let jpgData = bitmap?.representation(using: .jpeg, properties: [:]) else {
-                print("Failed to convert PNG to JPG")
+                KMPrint("Failed to convert PNG to JPG")
                 return filePath
             }
 
@@ -304,10 +304,10 @@ class KMImageToPDFManager: NSObject {
             let fileURL = URL(fileURLWithPath: jpgPath)
             do {
                 try jpgData.write(to: fileURL)
-                print("JPG image saved successfully")
+                KMPrint("JPG image saved successfully")
                 return fileURL.path
             } catch {
-                print("Failed to save JPG image: \(error.localizedDescription)")
+                KMPrint("Failed to save JPG image: \(error.localizedDescription)")
                 return filePath
             }
         }

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/KMBatchProcessingView.swift

@@ -163,7 +163,7 @@ extension KMBatchProcessingView: KMBatchProcessingViewAction {
     }
     
     func addFolder() {
-        print("addFolder")
+        KMPrint("addFolder")
         KMBatchProcessingView.openfiles(window: window!) { [unowned self] openPanel in
             if self.inputType == .OCR {
                 openPanel.allowedFileTypes = KMOCRModel.supportedTypes()
@@ -238,7 +238,7 @@ extension KMBatchProcessingView: KMBatchProcessingViewOpenPanel {
         
         panel.beginSheetModal(for: window, completionHandler: { result in
             if result != .OK {
-                print("取消")
+                KMPrint("取消")
                 completion(panel, [])
             } else {
                 completion(panel, panel.urls)

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/SelectedFiles/KMBatchSelectedFilesView.swift

@@ -68,7 +68,7 @@ protocol KMBatchSelectedFilesViewDrag {}
 extension KMBatchSelectedFilesView: KMBatchSelectedFilesViewDrag {
     
     override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
-        print("draggingEntered")
+        KMPrint("draggingEntered")
         if self.allowAccept(sender) {
             return .copy
         } else {
@@ -99,7 +99,7 @@ extension KMBatchSelectedFilesView: KMBatchSelectedFilesViewDrag {
     }
     
     override func draggingExited(_ sender: NSDraggingInfo?) {
-        print("draggingExited")
+        KMPrint("draggingExited")
     }
     
     func endDrag(sender: NSDraggingInfo, info: NSDictionary) {
@@ -107,7 +107,7 @@ extension KMBatchSelectedFilesView: KMBatchSelectedFilesViewDrag {
 //        point.y = sender.draggingLocation.y;
 //
 //        point = [self convertPoint:point fromView:nil];
-        print("endDrag")
+        KMPrint("endDrag")
         if (self.dragEnd != nil) {
             self.dragEnd!(self.data)
         }
@@ -133,7 +133,7 @@ extension KMBatchSelectedFilesView: KMBatchSelectedFilesViewDrag {
                         array.append(url! as URL)
                     }
                 default:
-                    print("无数据")
+                    KMPrint("无数据")
                 }
             }
             if array.count != 0 {

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/Tableview/KMBatchProcessingTableView.swift

@@ -275,7 +275,7 @@ extension KMBatchProcessingTableView: NSTableViewDelegate {
     }
     
     func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) {
-        print("选中")
+        KMPrint("选中")
     }
     
     func tableViewSelectionDidChange(_ notification: Notification) {
@@ -295,7 +295,7 @@ extension KMBatchProcessingTableView: NSTableViewDelegate {
     
     func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
         
-        print("选中3")
+        KMPrint("选中3")
         return true
     }
     

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMBatchProcessingView/Tableview/KMBatchProcessingTableViewModel/KMBatchProcessingTableViewModel.swift

@@ -68,7 +68,7 @@ class KMBatchProcessingTableViewModel: NSObject {
             model.filePath = filePath
             model.pageRange = KMPrintPageRange()
         } catch  {
-            print("error :\(error)")
+            KMPrint("error :\(error)")
         }
         
         return model

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/ImageToPDF/View/KMImageToPDFChooseView/KMImageToPDFChooseView.swift

@@ -42,7 +42,7 @@ class KMImageToPDFChooseView: KMBaseXibView {
     override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
 
-        print("Drawing code here.")
+        KMPrint("Drawing code here.")
     }
     
     override func setup() {

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/OCR/KMOCRWindowController.swift

@@ -16,7 +16,7 @@ class KMOCRWindowController: NSWindowController {
     var inputType: DataNavigationViewButtonActionType?
     
     deinit {
-        print("KMOCRWindowController 释放")
+        KMPrint("KMOCRWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -62,13 +62,13 @@ class KMOCRWindowController: NSWindowController {
 
 extension KMOCRWindowController: KMImageToPDFChooseViewDelegate {
     func exportAction(data: KMImageToPDFChooseModel) {
-        print("导出")
+        KMPrint("导出")
         self.chooseData = data
 
         if self.batchData != nil {
             self.chooseData?.imageFilePaths = self.batchData
             KMImageToPDFManager.manager.exportPDF(model: self.chooseData!) { success, savePath, errors, OCRerrors in
-                print(success)
+                KMPrint(success)
                 if success {
                     NSWorkspace.shared.selectFile(savePath, inFileViewerRootedAtPath: "");
                 }  else {
@@ -87,7 +87,7 @@ extension KMOCRWindowController: KMImageToPDFChooseViewDelegate {
 
 extension KMOCRWindowController: KMOCRChooseViewDelegate {
     func exportAction(data: KMOCRModel) {
-        print("export ocr success")
+        KMPrint("export ocr success")
     }
 }
 

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/OCR/Presenter/KMOCRPresenter.swift

@@ -75,7 +75,7 @@ extension KMOCRPresenter: KMOCRPresenterProtocol {
     }
     
     @objc func language(sender: NSMenuItem) {
-        print(sender.representedObject!)
+        KMPrint(sender.representedObject!)
         let dic: NSDictionary = sender.representedObject as! NSDictionary
         self.model.languageDic = dic
         self.model.languageType = KMOCRLanguageType.init(rawValue: dic[KMGOCRLanguageCodeKey] as! String)

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/OCR/View/KMOCRChooseView/KMOCRChooseView.swift

@@ -26,7 +26,7 @@ class KMOCRChooseView: KMBaseXibView {
     override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
 
-        print("Drawing code here.")
+        KMPrint("Drawing code here.")
     }
     
     override func setup() {

+ 6 - 6
PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift

@@ -51,7 +51,7 @@ class KMPrintWindowController: NSWindowController, NetServiceBrowserDelegate {
     }
     
     deinit {
-        print("KMImageToPDFWindowController 释放")
+        KMPrint("KMImageToPDFWindowController 释放")
     }
     
     override func windowDidLoad() {
@@ -77,7 +77,7 @@ class KMPrintWindowController: NSWindowController, NetServiceBrowserDelegate {
     }
     
     func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) {
-        print(service)
+        KMPrint(service)
         // output: <NSNetService 0x1c0228960> local. _ipp._tcp. RICOH imagio MP C3302 [002673499B5F] -1
     }
     
@@ -285,11 +285,11 @@ extension NetService {
 
 extension KMPrintWindowController: KMPrintBottomViewDelegate {
     func savePDFAction() {
-        print("保存PDF")
+        KMPrint("保存PDF")
     }
     
     func printerAction() {
-        print("调用打印机打印")
+        KMPrint("调用打印机打印")
         if self.chooseData.url != nil {
             let document = PDFDocument.init(url: self.chooseData.url!)
             let printInfo = NSPrintInfo.shared
@@ -301,7 +301,7 @@ extension KMPrintWindowController: KMPrintBottomViewDelegate {
     }
     
     func cancelAction() {
-        print("cancel")
+        KMPrint("cancel")
         NSApp.mainWindow!.endSheet(self.window!)
         self.close()
 //        self.window?.orderOut(self)
@@ -309,7 +309,7 @@ extension KMPrintWindowController: KMPrintBottomViewDelegate {
     
     func printAction() {
         
-        print("打印机直接打印")
+        KMPrint("打印机直接打印")
         let document = PDFDocument.init(url: self.chooseData.url!)
         let printInfo = NSPrintInfo.shared
         let printOperation: NSPrintOperation = document!.printOperation(for: printInfo, scalingMode: .pageScaleNone, autoRotate: true)!

+ 3 - 3
PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter.swift

@@ -64,7 +64,7 @@ extension KMPrintPresenter: KMPrintPresenterDocument {
         if self.delegate != nil {
             self.delegate?.showData(presenter: self, document: result)
         }
-        print("保存地址" + filePath)
+        KMPrint("保存地址" + filePath)
         return result
      }
     
@@ -296,7 +296,7 @@ extension KMPrintPresenter: KMPrintPresenterDocument {
                     }
                 }
             default:
-                print("未找到")
+                KMPrint("未找到")
                 break
             }
         }
@@ -387,7 +387,7 @@ extension KMPrintPresenter: KMPrintPresenterDocument {
                             origin.x = paperSize.width - (pageSize.width + columnAndRowSpace.x) * (CGFloat(i) + 1) + center.x + columnAndRowSpace.x
                             origin.y = paperSize.height - (pageSize.height + columnAndRowSpace.y) * (CGFloat(j) + 1) + center.y + paperInset.bottom + columnAndRowSpace.y
                         default:
-                            print("未找到")
+                            KMPrint("未找到")
                             break
                         }
                     }

+ 8 - 8
PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter_C.swift

@@ -60,9 +60,9 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
         //插入page
         let insertSuccess = self.insertPages(document: previewDocument, printModel: printModel, pages: pages)
         if insertSuccess {
-            print("插入成功")
+            KMPrint("插入成功")
         } else {
-            print("插入失败")
+            KMPrint("插入失败")
         }
 
         //重置document
@@ -71,7 +71,7 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
         if self.delegate != nil {
             self.delegate?.showData(presenter: self, document: previewDocument)
         }
-        print("保存地址" + filePath)
+        KMPrint("保存地址" + filePath)
         return previewDocument
     }
     /**
@@ -133,9 +133,9 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
                     success = document.insertPageObject(page, at: UInt(index))
                 }
                 if success {
-                    print("插入成功")
+                    KMPrint("插入成功")
                 } else {
-                    print("插入失败")
+                    KMPrint("插入失败")
                     result = false
                 }
             }
@@ -184,9 +184,9 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
             success = NSData(data: document.dataRepresentation()).write(to: url, atomically: true)
         }
         if success {
-            print("保存成功" + filePath)
+            KMPrint("保存成功" + filePath)
         } else {
-            print("保存失败")
+            KMPrint("保存失败")
         }
 
         return filePath
@@ -242,7 +242,7 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
                 }
 
             default:
-                print("无匹配选项")
+                KMPrint("无匹配选项")
             }
             return pagesArray
         }

+ 6 - 6
PDF Office/PDF Master/Class/PDFTools/Tools/TextField/KMBaseTextField.swift

@@ -124,7 +124,7 @@ extension KMBaseTextField: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if inputView == textField {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     if self.textDidEndEditing != nil {
                         self.textDidEndEditing!(self.model.stringValue)
                     }
@@ -135,7 +135,7 @@ extension KMBaseTextField: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if inputView == textField {
-                    print("按下 delete")
+                    KMPrint("按下 delete")
                     if inputView.stringValue == "" {
                         if self.textDeleteAction != nil {
                             self.textDeleteAction!(self.model.stringValue)
@@ -152,7 +152,7 @@ extension KMBaseTextField: NSTextFieldDelegate {
     }
                 
     func controlTextDidChange(_ obj: Notification) {
-        print("controlTextDidChange")
+        KMPrint("controlTextDidChange")
         if self.textField.stringValue.count >= self.maxLen {
             var string = self.textField.stringValue
             string = String(string.prefix(1))
@@ -165,7 +165,7 @@ extension KMBaseTextField: NSTextFieldDelegate {
     }
     
     func controlTextDidEndEditing(_ obj: Notification) {
-        print("controlTextDidEndEditing")
+        KMPrint("controlTextDidEndEditing")
         self.presenter.changeValue(value: self.textField.stringValue)
         
         if self.textDidEndEditing != nil {
@@ -174,14 +174,14 @@ extension KMBaseTextField: NSTextFieldDelegate {
     }
     
     func controlTextDidBeginEditing(_ obj: Notification) {
-        print("controlTextDidBeginEditing")
+        KMPrint("controlTextDidBeginEditing")
         if self.textDidBeginEditing != nil {
             self.textDidBeginEditing!(self.model.stringValue)
         }
     }
     
     func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool {
-        print("textShouldEndEditing")
+        KMPrint("textShouldEndEditing")
         return true
     }
 }

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Watermark/Tools/KMWatermarkManager.swift

@@ -343,7 +343,7 @@ class KMWatermarkManager: NSObject {
                 dict[KMWatermarkKey.imagePath.rawValue] = path?.lastPathComponent
             }
             catch {
-                print("Failed to write to disk.")
+                KMPrint("Failed to write to disk.")
                 return [:]
             }
         }

+ 11 - 11
PDF Office/PDF Master/Class/PDFWindowController/ReadModelView/KMReadModelView.swift

@@ -298,30 +298,30 @@ extension KMReadModelView {
 //MARK: Mouse
 extension KMReadModelView {
     override func mouseDown(with event: NSEvent) {
-        print("mouseDown")
+        KMPrint("mouseDown")
     }
     
     override func mouseUp(with event: NSEvent) {
-        print("mouseUp")
+        KMPrint("mouseUp")
     }
     
     override func mouseMoved(with event: NSEvent) {
-        print("mouseMoved")
+        KMPrint("mouseMoved")
     }
     
     override func mouseEntered(with event: NSEvent) {
-        print("mouseEntered")
+        KMPrint("mouseEntered")
     }
 
     override func mouseExited(with event: NSEvent) {
-        print("mouseExited")
+        KMPrint("mouseExited")
     }
 }
 
 //MARK: PopButton
 extension KMReadModelView: KMSelectPopButtonDelegate {
     func km_comboBoxSelectionDidChange(_ obj: KMDesignSelect) {
-        print("km_comboBoxSelectionDidChange")
+        KMPrint("km_comboBoxSelectionDidChange")
         self.updateUI()
         self.delegate?.scaleDidChange(view: self, sender: obj, type: KMReadModelViewScaleType(rawValue: KMReadModelViewScaleType.allValues()[obj.indexOfSelectedItem]) ?? .autoSize)
     }
@@ -375,12 +375,12 @@ extension KMReadModelView {
 //MARK: Action
 extension KMReadModelView {
     @IBAction func escButtonAction(_ sender: Any) {
-        print("read model escButtonAction")
+        KMPrint("read model escButtonAction")
         self.delegate?.cancelReadModel(view: self, sender: sender)
     }
     
     @objc func firstPageButtonAction(sender: Any) {
-        print("firstPageButtonAction")
+        KMPrint("firstPageButtonAction")
         if self.canFirstPageButtonAction() {
             self.delegate?.firstPageButtonDidChange(view: self, sender: sender)
         }
@@ -388,7 +388,7 @@ extension KMReadModelView {
     }
     
     @objc func beforePageButtonAction(sender: Any) {
-        print("beforePageButtonAction")
+        KMPrint("beforePageButtonAction")
         if self.canBeforePageButtonAction() {
             self.delegate?.beforePageButtonDidChange(view: self, sender: sender)
         }
@@ -396,7 +396,7 @@ extension KMReadModelView {
     }
     
     @objc func afterPageButtonAction(sender: Any) {
-        print("afterPageButtonAction")
+        KMPrint("afterPageButtonAction")
         if self.canAfterPageButtonAction() {
             self.delegate?.afterPageButtonDidChange(view: self, sender: sender)
         }
@@ -404,7 +404,7 @@ extension KMReadModelView {
     }
     
     @objc func lastPageButtonAction(sender: Any) {
-        print("lastPageButtonAction")
+        KMPrint("lastPageButtonAction")
         if self.canLastPageButtonAction() {
             self.delegate?.lastPageButtonDidChange(view: self, sender: sender)
         }

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift

@@ -49,7 +49,7 @@ class KMAnnotationViewController: KMSideViewController {
     
     
     deinit {
-        print("KMAnnotationViewController")
+        KMPrint("KMAnnotationViewController")
         self.removeNotification()
     }
     //MARK: View
@@ -437,7 +437,7 @@ extension KMAnnotationViewController {
                     var content: String = annotationItem.annotation!.contents!
                     let item: CPDFMarkupAnnotation = annotationItem.annotation! as? CPDFMarkupAnnotation ?? CPDFMarkupAnnotation()
                     if item.markupText() != nil {
-                        print(item.markupText() as Any)
+                        KMPrint(item.markupText() as Any)
                         content = content + "\n" + item.markupText()
                     }
 
@@ -737,7 +737,7 @@ extension KMAnnotationViewController {
                 page?.removeAnnotation(annotation)
                 annotationItem.section?.annotations?.removeObject(annotationItem)
             } else {
-                print("不存在")
+                KMPrint("不存在")
             }
             
             if self.listView.activeAnnotations.contains(annotation!) {

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMScreenViewController/ScreenCollectionView/View/KMAnnotationScreenTypeViewItem.swift

@@ -49,7 +49,7 @@ extension KMAnnotationScreenTypeViewItem {
     }
     
     func updateButtonState(typeString: String, select: Bool) {
-        print(typeString)
+        KMPrint(typeString)
         self.typeString = typeString
         var image = NSImage()
         switch typeString {

+ 0 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMAnnotationTableRowView.swift

@@ -49,14 +49,6 @@ class KMAnnotationTableRowView: NSTableRowView {
                 self.needsDisplay = true
             }
             
-//            self.box?.rightDownCallback = { [unowned self] (downEntered, mouseBox, event) in
-//                print("rightDownCallback")
-//                guard let callBack = rightMouseDownAction else { return }
-//
-//                callBack(self, self.box!, event)
-//            }
-            
-            
             self.contentBox?.wantsLayer = true
             self.contentBox = KMBox(frame: self.bounds)
             self.contentBox?.borderWidth = 0

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/BookMarks/KMBookMarkViewController.swift

@@ -473,7 +473,7 @@ extension KMBookMarkViewController {
     func deleteBookMark(bookMarks: [KMBookMarkItem]) {
         for bookMark in bookMarks {
             if self.listView.document.removeBookmark(forPageIndex: bookMark.index) {
-                print("删除标签成功")
+                KMPrint("删除标签成功")
             }
         }
         self.listView.setNeedsDisplayForVisiblePages()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Outline/KMOutlineViewController.swift

@@ -473,7 +473,7 @@ extension KMOutlineViewController {
     }
     
     func updateOutlineSelection() {
-        print("updateOutlineSelection")
+        KMPrint("updateOutlineSelection")
         let currentPageIndex = self.listView.currentPageIndex
         let numRows = self.BOTAOutlineView.outlineView.numberOfRows
         if numRows > 0 {

+ 0 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Outline/OutlineView/KMBOTAOutlineView.swift

@@ -214,9 +214,6 @@ extension KMBOTAOutlineView : NSOutlineViewDataSource,NSOutlineViewDelegate {
             let attributes = [NSAttributedString.Key.paragraphStyle: paragraphStyle,
                               NSAttributedString.Key.font : NSFont.SFProTextRegular(14.0)]
             let size = string.boundingRect(with: CGSizeMake(outlineView.frame.size.width - 30, 200), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes)
-            print(outlineView.frame.size.width - 30)
-            print(string)
-            print(size.height)
             return max(40, size.height + 16)
         }
         return 40

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMSearchViewController.swift

@@ -591,7 +591,6 @@ extension KMSearchViewController: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if inputView == searchTextField {
-                    print("按下 enter")
                     self.searchDoneAction()
                 }
             }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMPDFThumbnailView.swift

@@ -169,7 +169,7 @@ extension KMPDFThumbnailView {
                     //标记线
                     if collectionView == self.collectionView {
                         var rect = self.collectionView.frameForItem(at: proposedDropIndexPath.pointee.item)
-                        print("标记线范围 \(rect)")
+                        KMPrint("标记线范围 \(rect)")
                         rect.size.height = 2
                         self.markerLineView.frame = rect
                         self.markerLineView.isHidden = false

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/CipherTextView/CipherTextView.swift

@@ -28,7 +28,7 @@ class CipherTextView: NSView,NibLoadable {
       
     @IBAction func buttonAction(_ sender: NSButton) {
         if sender == self.settingBtn {
-            print("setting")
+            KMPrint("setting")
 //            if self.cipherTextDelegate && self.cipherTextDelegate resp
             if self.cipherTextDelegate != nil {
                 self.cipherTextDelegate.cipherTextViewButtonClicked(textView: self, buttonIndex: 0)

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/Category/KMImageOptimization.swift

@@ -140,9 +140,9 @@ class KMImageOptimization: NSObject {
             do {
                 try compressedData.write(to: saveURL)
                 // 图像已成功保存在指定路径中
-                print("保存图像成功:\(string)")
+                KMPrint("保存图像成功:\(string)")
             } catch {
-                print("保存图像失败:\(error)")
+                KMPrint("保存图像失败:\(error)")
             }
         }
         

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.swift

@@ -375,7 +375,7 @@ class KMEditImagePropertyViewController: NSViewController {
 extension KMEditImagePropertyViewController: KMSelectPopButtonDelegate {
     func km_comboBoxSelectionDidChange(_ obj: KMDesignSelect) {
         if obj == opacityVC {
-            print("km_comboBoxSelectionDidChange")
+            KMPrint("km_comboBoxSelectionDidChange")
             let index = obj.indexOfSelectedItem
             var string = obj.items[index]
             string = string.replacingOccurrences(of: "%", with: "")
@@ -386,7 +386,7 @@ extension KMEditImagePropertyViewController: KMSelectPopButtonDelegate {
     
     func km_controlTextDidEndEditing(_ obj: KMDesignSelect) {
         if obj == opacityVC {
-            print("km_comboBoxSelectionDidChange")
+            KMPrint("km_comboBoxSelectionDidChange")
             let index = obj.indexOfSelectedItem
             var string = obj.items[index]
             string = string.replacingOccurrences(of: "%", with: "")

+ 0 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -110,7 +110,6 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         NSColorPanel.shared.setTarget(nil)
         NSColorPanel.shared.setAction(nil)
         NSColorPanel.shared.close()
-        KMPrint("\(self)")
     }
     
     override func viewDidLoad() {
@@ -506,7 +505,6 @@ extension KMEditPDFTextPropertyViewController: KMSelectPopButtonDelegate {
         if obj == textPresuppositionVC {
             let type = KMEditPDFTextFontType.typeOfRawValue(value: KMEditPDFTextFontType.allValues()[obj.indexOfSelectedItem])
             self.updateTextPresupposition(type: type)
-            print("km_comboBoxSelectionDidChange")
         } else if obj == fontNameVC {
             self.updateFontNameAndStyle(name: obj.stringValue, style: fontStyle)
             self.updatePreviewImage()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/Manager/KMEditPDFTextManager.swift

@@ -264,7 +264,7 @@ extension KMEditPDFTextManager {
             attributeFontDescriptor = NSFontDescriptor.init(fontAttributes: [NSFontDescriptor.AttributeName.family: FONTNAME_DEFAULT])
             font = NSFont.init(descriptor: attributeFontDescriptor, size: fontSize)
         }
-        print("----------------" + tempFontName + "----------------" + style + "----------------")
+        KMPrint("----------------" + tempFontName + "----------------" + style + "----------------")
         if font == nil {
             return NSImage()
         }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/View/AlignmentView/KMEditPropertyAlignmentView.swift

@@ -193,7 +193,7 @@ extension KMEditPropertyAlignmentView {
     }
     
     func updateFormAearsAlignMangent(stype: CPDFActiveAreasAlignType) {
-        print("updateFormAearsAlignMangent")
+        KMPrint("updateFormAearsAlignMangent")
         let editingAreas = self.editingAreas
         if editingAreas.count >= 2 {
             

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -361,7 +361,7 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
 //                //当当前TextField按下enter
                 if inputView == zoomTextField {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     self.delegate?.toolbarViewController?(self, zoomSting: self.zoomTextField.stringValue)
                 }
             }

+ 6 - 6
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -390,7 +390,7 @@ extension KMMainViewController {
         point2 = CGPoint(x: self.listView.bounds.width - point2.x, y: self.listView.bounds.height - point2.y)
         point = point2
         if sender.tag == 0 {
-            print("添加文字")
+            KMPrint("添加文字")
             let isSelect = self.toolbarController.findItem(KMToolbarAddTextEditPDFItemIdentifier)?.isSelected ?? false
             if !isSelect {
                 self.toolbarController.selectItem(KMToolbarAddTextEditPDFItemIdentifier)
@@ -398,14 +398,14 @@ extension KMMainViewController {
             
 //            self.pdfViewEditingAddTextArea(self.listView, add: CGRectMake(point.x, point.y, 0, 0))
         } else if sender.tag == 1 {
-            print("添加图片")
+            KMPrint("添加图片")
             let isSelect = self.toolbarController.findItem(KMToolbarAddImageEditPDFItemIdentifier)?.isSelected ?? false
             if !isSelect {
                 self.toolbarController.selectItem(KMToolbarAddImageEditPDFItemIdentifier)
             }
 //            self.pdfViewEditingAddImageArea(self.listView, add: CGRectMake(point.x, point.y, 0, 0))
         } else if sender.tag == 2 {
-            print("粘贴")
+            KMPrint("粘贴")
         }
     }
     
@@ -1720,7 +1720,7 @@ extension KMMainViewController {
                     try fileManager.moveItem(at: fileURL!, to: newFileURL)
                 } catch {
                     result = false
-                    print("Error renaming file! Threw: \(error.localizedDescription)")
+                    KMPrint("Error renaming file! Threw: \(error.localizedDescription)")
                 }
                 if (result) {
                     tabController?.title = outputSavePanel.url!.lastPathComponent
@@ -2878,7 +2878,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
 extension KMMainViewController {
     override func mouseDown(with event: NSEvent) {
         super.mouseDown(with: event)
-        print("KMMainViewController mouseDown")
+        KMPrint("KMMainViewController mouseDown")
         self.leftSideViewCancelSelect()
         self.pageNumberDisplayView.isEdit = false
     }
@@ -2899,7 +2899,7 @@ extension KMMainViewController {
         case .Annotation:
             self.leftSideViewController.annotationViewController.cancelSelect()
         default:
-            print("其他")
+            KMPrint("其他")
         }
     }
 }

+ 10 - 10
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -648,7 +648,7 @@ import Cocoa
                 return megabyteSize >= 10
             }
         } catch {
-            print("Error: \(error)")
+            KMPrint("Error: \(error)")
         }
 
         return false
@@ -1369,7 +1369,7 @@ import Cocoa
     //MARK: - PDFListViewDelegate
     func pdfViewDocumentDidLoaded(_ pdfView: CPDFView!) {
 #if DEBUG
-        print("pdfViewDocumentDidLoaded")
+        KMPrint("pdfViewDocumentDidLoaded")
 #endif
         self.removeBackgroundMaskView()
         if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
@@ -1409,13 +1409,13 @@ import Cocoa
     func pdfViewCurrentPageDidChanged(_ pdfView: CPDFView!) {
         self.updatePageIndicatoreType()
         NotificationCenter.default.post(name: NSNotification.Name.init(rawValue: "KMPDFViewCurrentPageDidChanged"), object: self.document)
-        print("KMPDFViewCurrentPageDidChanged")
+        KMPrint("KMPDFViewCurrentPageDidChanged")
     }
     
     func pdfViewScaleDidChanged(_ pdfView: CPDFView!) {
         self.toolbarController.mainToolBarView?.zoomTextField.stringValue = "\(Int(self.listView.scaleFactor * 100))%"
         self.updateZoomInOutButtonState()
-        print("pdfViewScaleDidChanged")
+        KMPrint("pdfViewScaleDidChanged")
     }
     
     func pdfViewDidClick(onLink pdfView: CPDFView!, withURL url: String!) {
@@ -1429,27 +1429,27 @@ import Cocoa
     }
     
     func pdfViewPerformURL(_ pdfView: CPDFView!, withContent content: String!) {
-        print("pdfViewPerformURL")
+        KMPrint("pdfViewPerformURL")
     }
     
     func pdfViewPerformPrint(_ pdfView: CPDFView!) {
-        print("pdfViewPerformPrint")
+        KMPrint("pdfViewPerformPrint")
     }
     
     func pdfViewPerformGo(toPage pdfView: CPDFView!) {
-        print("pdfViewPerformGo")
+        KMPrint("pdfViewPerformGo")
     }
     
     func pdfViewOpenPDF(_ pdfView: CPDFView!, forRemoteGoTo action: CPDFAction!) {
-        print("pdfViewOpenPDF")
+        KMPrint("pdfViewOpenPDF")
     }
     
     func pdfViewPerformReset(_ pdfView: CPDFView!) {
-        print("pdfViewPerformReset")
+        KMPrint("pdfViewPerformReset")
     }
     
     func pdfViewEditingBlockDidChanged(_ pdfView: CPDFView!) {
-        print("pdfViewEditingBlockDidChanged")
+        KMPrint("pdfViewEditingBlockDidChanged")
     }
     
     func pdfViewAsBookBookmark() -> NSImage! {

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/Views/KMPageNumberDisplayView/KMPageNumberDisplayView.swift

@@ -159,7 +159,7 @@ class KMPageNumberDisplayView: KMBaseXibView {
 //MARK: mouse
 extension KMPageNumberDisplayView {
     override func mouseDown(with event: NSEvent) {
-        print("mouseDown")
+        KMPrint("mouseDown")
         if !self.isEdit {
             self.isEdit = true
             self.delegate?.updateWidth(view: self, width: self.fetchWith(edit: self.isEdit))
@@ -181,7 +181,7 @@ extension KMPageNumberDisplayView: NSTextFieldDelegate {
             if let inputView = control as? NSTextField {
                 //当当前TextField按下enter
                 if (textView.string == self.currentPageIndexLabel.stringValue) {
-                    print("按下 enter")
+                    KMPrint("按下 enter")
                     self.isEdit = false
                     self.toPageIndex()
                 }