Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics

I just get an error "[boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics" while to get JSON data from API link. Before it worked and I just updated Xcode version 13.1. I was checking every forum but I couldn't find a way to solve it. Anyone had the same problem before, please help me. Thank you.

func parse() {
    
    let jsonUrlString = "https://api.tiki.vn/shopping-trend/api/trendings/hub?cursor=0&limit=20"
    
    guard let url = URL(string: jsonUrlString)
    else {
        return
    }
    
    URLSession.shared.dataTask(with: url) { [self]
        data, response, err in
        if err != nil {
            print(err as Any)
            return
        }
        do {
            let result = try  JSONDecoder().decode(Data.self, from: data!)
            DispatchQueue.main.async {
                self.items = (result.data?.data)!
                print(items)
            }
        } catch {
            print("Error")
        }
    }
    .resume()
}
like image 993
Boboly Avatar asked Oct 31 '21 09:10

Boboly


1 Answers

Try executing this command in Terminal:

xcrun simctl spawn booted log config --subsystem com.apple.network --category boringssl --mode "level:off"

It should turn off these annoying console logs.
Note - if you switch to another iOS Simulator, you have to repeat this command again.

like image 177
Evgeny Karkan Avatar answered Nov 13 '22 00:11

Evgeny Karkan