浏览代码

LOG 添加区分人员和上报 bugly 方式

jsonwang 3 年之前
父节点
当前提交
eea7956261
共有 1 个文件被更改,包括 25 次插入17 次删除
  1. 25 17
      BFFramework/Classes/Utils/PQCommonMethodUtil.swift

+ 25 - 17
BFFramework/Classes/Utils/PQCommonMethodUtil.swift

@@ -132,27 +132,35 @@ public func kf_imageCacheImage(originUrl: String, completeHandle: @escaping (_ i
     }
 }
 
-/** 打印 */
-public func BFLog<T>( _ type : Int = 9, _ file:String = #file, _ line:Int = #line, message: T) {
+/** 打印
+   type = 1 : 胡志强
+   type = 2 :王成
+   type = 3 : 文伟伟
+ 
+ */
+public func BFLog<T>( _ type : Int = 0, _ file:String = #file, _ line:Int = #line, message: T) {
+   
+    let file = (file as NSString).lastPathComponent;
+    let msg = "\(file) (L:\(line)) \(message)"
+    if type == 0{ 
+        BuglyLog.level(.warn, logs: msg)
+    }
 #if DEBUG
-    if type == 0 {
-        print(message)
-    }else if type == 3 {
-        let file = (file as NSString).lastPathComponent;
+     if type == 1 {
         let dateFmt = DateFormatter()
         dateFmt.dateFormat = "HH:mm:ss:SSSS"
-        print("hhz-\(dateFmt.string(from: Date())) \(file):(\(line))--\(message)");
-    }
+        print("hhz-\(dateFmt.string(from: Date())) \(msg)");
+     }else if type == 2 {
+        let dateFmt = DateFormatter()
+        dateFmt.dateFormat = "HH:mm:ss:SSSS"
+        print("ak-\(dateFmt.string(from: Date())) \(msg)");
+     }else if type == 3 {
+        let dateFmt = DateFormatter()
+        dateFmt.dateFormat = "HH:mm:ss:SSSS"
+        print("ww-\(dateFmt.string(from: Date())) \(msg)");
+     }
+ 
 #endif
-//    if PQENVUtil.shared.envMode == .ENVModeTest {
-//     
-//    }else{
-//        if(PQBFConfig.shared.enableBFLog){
-//            print(message)
-//        }else{
-//            BuglyLog.level(.warn, logs: message as? String)
-//        }
-//    }
  
 }