kasketis / netfox

A lightweight, one line setup, iOS / OSX network debugging library! 🦊
MIT License
3.65k stars 368 forks source link

Add Control '[NFX]: Failed to load data..' annoying printing issue with flag value. #258

Open jwhwangbirdview opened 1 year ago

jwhwangbirdview commented 1 year ago

Problem

while netfox is setting, '[NFX]: Failed to load data..' error statement keeps displaying all over the console.

Sceenshot

Screenshot 2023-04-05 at 5 51 56 PM

Solution

This issue is already reported by @iVaschee ( https://github.com/kasketis/netfox/issues/249 ) but no one suggests good solution for this. and i tried debugging the problem so what i suspect is Data(contentsOf: fileURL) part has a authority-to-access problem or some address issue. I cannot find the good solution for this without change the core logic other than just controling printing with flag.

public static func setDebugErrorPrintEnabled(with enabled: Bool) {
        debugErrorPrintEnabled = enabled
 }

I think right now the logic is not affected by this kind of flag-controlled logic. '[NFX]: Failed to load data..' error is so annoying and making it hard to see other invaluable logs. So I hope to be confirmed this alternative code. Thanks

wrutkowski-tyro commented 1 year ago

244 is fixing the same thing