Przeglądaj źródła

Merge branch 'master' of https://git.yishihui.com/iOS/BFCommonKit

* 'master' of https://git.yishihui.com/iOS/BFCommonKit:
  1.update log
  1.update log
harry 3 lat temu
rodzic
commit
88d350c22e
1 zmienionych plików z 22 dodań i 19 usunięć
  1. 22 19
      BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

+ 22 - 19
BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

@@ -125,23 +125,26 @@ public func bf_getCurrentViewController() -> UIViewController? {
 
  */
 public func BFLog<T>(_ type: Int = 0, _ file: String = #file, _ line: Int = #line, message: T) {
-    let filePath = (file as NSString).lastPathComponent;
-    let dateFmt = DateFormatter()
-    dateFmt.dateFormat = "HH:mm:ss:SSSS"
-    let msg = "\(filePath) (L:\(line)) \(message)"
-//    if type == 0{
-    ////        BuglyLog.level(.warn, logs: msg)
-        print("\(dateFmt.string(from: Date())) \(msg)")
-//    }
-#if DEBUG
-     if type == 1 {
-        print("hhz-\(dateFmt.string(from: Date())) \(msg)");
-     }else if type == 2 {
-        print("ak-\(dateFmt.string(from: Date())) \(msg)");
-     }else if type == 3 {
-        print("ww-\(dateFmt.string(from: Date())) \(msg)");
-     }
-//
+    #if DEBUG
+        let filePath = (file as NSString).lastPathComponent
+        let dateFmt = DateFormatter()
+        dateFmt.dateFormat = "HH:mm:ss:SSSS"
+        let msg = "\(filePath) (L:\(line)) \(message)"
+        if type == 1 {
+            print("hhz-\(dateFmt.string(from: Date())) \(msg)")
+        } else if type == 2 {
+            print("ak-\(dateFmt.string(from: Date())) \(msg)")
+        } else if type == 3 {
+            print("ww-\(dateFmt.string(from: Date())) \(msg)")
+        } else {
+            print("\(dateFmt.string(from: Date())) \(msg)")
+        }
+    #else
+//    let filePath = (file as NSString).lastPathComponent;
+//    let dateFmt = DateFormatter()
+//    dateFmt.dateFormat = "HH:mm:ss:SSSS"
+//    let msg = "\(filePath) (L:\(line)) \(message)"
+//    BuglyLog.level(.warn, logs: msg)
     #endif
 }
 
@@ -810,7 +813,7 @@ public var avAssertOptions: [String: Any]? = {
 /// 播放动画图
 public var playGifImages: [UIImage] = {
     var gifImages = Array<UIImage>.init()
-    for i in 0...44 {
+    for i in 0 ... 44 {
         gifImages.append(UIImage(named: "\(i).png")!)
     }
 
@@ -848,7 +851,7 @@ public func zipImageQuality(image: UIImage, maxLength: NSInteger, cyles: Int = 6
     var max: CGFloat = 1
     var min: CGFloat = 0
     var bestData: Data = data
-    for _ in 0..<cyles {
+    for _ in 0 ..< cyles {
         compression = (max + min) / 2
         data = image.jpegData(compressionQuality: compression)!
         if Double(data.count) < Double(maxLength) * 0.9 {