Browse Source

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

wenweiwei 3 years ago
parent
commit
e3fba1f96c
1 changed files with 14 additions and 16 deletions
  1. 14 16
      BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

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

@@ -124,25 +124,23 @@ public func bf_getCurrentViewController() -> UIViewController? {
    type = 3 : 文伟伟
    type = 3 : 文伟伟
 
 
  */
  */
-public func BFLog<T>(_: Int = 0, _ file: String = #file, _ line: Int = #line, message: T) {
+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{
 //    if type == 0{
     ////        BuglyLog.level(.warn, logs: msg)
     ////        BuglyLog.level(.warn, logs: msg)
-    let dateFmt = DateFormatter()
-    let msg = "\(file) (L:\(line)) \(message)"
-    print("\(dateFmt.string(from: Date())) \(msg)")
+        print("\(dateFmt.string(from: Date())) \(msg)")
 //    }
 //    }
-    #if DEBUG
-//    let dateFmt = DateFormatter()
-//    dateFmt.dateFormat = "HH:mm:ss:SSSS"
-//    let file = (file as NSString).lastPathComponent;
-//    let msg = "\(file) (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)");
-//     }
+#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
     #endif
 }
 }