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

Merge branch 'master' into module

# Conflicts:
#	BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift
harry 3 лет назад
Родитель
Сommit
ad7a271cb3
1 измененных файлов с 44 добавлено и 14 удалено
  1. 44 14
      BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

+ 44 - 14
BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

@@ -132,22 +132,34 @@ public func kf_imageCacheImage(originUrl: String, completeHandle: @escaping (_ i
     }
 }
 
-/** 打印 */
-public func BFLog<T>(message: T) {
-//    if PQBFConfig.shared.enableBFLog {
-
-//    let logger = NXLogger.shared
-//
-//    logger.level = .info
-//    logger.ouput = .debuggerConsole
-//
-//    logger.d(message as? String ?? "")
-//    } else {
-//        BuglyLog.level(.warn, logs: message as? String)
-//    }
+/** 打印
+   type = 1 : 胡志强
+   type = 2 :王成
+   type = 3 : 文伟伟
+ 
+ */
+public func BFLog<T>( _ type : Int = 0, _ file:String = #file, _ line:Int = #line, message: T) {
+    let dateFmt = DateFormatter()
+    dateFmt.dateFormat = "HH:mm:ss:SSSS"
+    let file = (file as NSString).lastPathComponent;
+    let msg = "\(file) (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)");
+     }
+ 
+#endif
+ 
 }
 
-
 // MARK: 获取公共参数
 
 public func commonParams() -> [String: Any] {
@@ -939,3 +951,21 @@ public func getLaunchImage() -> UIImage {
     }
     return lauchImg
 }
+
+public func currentBundlePath() -> Bundle?{
+//    var associateBundleURL = Bundle.main.url(forResource: "Frameworks", withExtension: nil)
+//    associateBundleURL = associateBundleURL?.appendingPathComponent("BFFramework")
+//    associateBundleURL = associateBundleURL?.appendingPathExtension("framework")
+//
+//    if associateBundleURL == nil {
+//        print("获取bundle失败")
+//        return nil
+//    }
+//    let associateBunle = Bundle(url: associateBundleURL!)
+    let associateBundleURL = Bundle.main.url(forResource: "BFFramework_Resources", withExtension: "bundle")
+    if associateBundleURL == nil {
+        return nil
+    }
+    return Bundle(url: associateBundleURL!)
+}
+