Instabug / Instabug-iOS

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
290 stars 67 forks source link

Can I make Instabug logs less verbose? #419

Closed algrid closed 3 years ago

algrid commented 3 years ago

Hi!

I see a lot of logs like this in my console:

[Instabug] - IBGUser Steps: Captured screenshot using currentImageContext = <UIImage:0x6000038a7720 anonymous {414, 896}>

and these line when going to background:

[Instabug] - IBGUser Steps: Couldn't save userstep to CoreData in addStep. Error: Error Domain=Application in background Code=404 "(null)" [Instabug] - IBGUser Steps: Failed to save reproStep with screenshot, error: Error Domain=Application in background Code=404 "(null)"

Is there a way to turn off these logs? Too much logs make it hard to debug other stuff in the app (I know, I can filter logs, but still...).

SDK Version

10.5.1

iOS Version

14.4

Kmohamed commented 3 years ago

hi @algrid Yes, you can. You can add this API before startWithToken Instabug.sdkDebugLogsLevel = .error;

algrid commented 3 years ago

@Kmohamed

I just tried it:

Instabug.sdkDebugLogsLevel = .error
print("\(Instabug.sdkDebugLogsLevel == .error)")

It prints true, but I still can see those "Captured screenshot" messages.

Kmohamed commented 3 years ago

Did you call it before StartWithToken? btw Instabug.sdkDebugLogsLevel = .error will print the error messages only from Instabug, and you can completely disabling it using this line Instabug.sdkDebugLogsLevel = .none

algrid commented 3 years ago

@Kmohamed I was calling it after StartWithToken. Moved it to call before StartWithToken, but the result is the same.

algrid commented 3 years ago

Tried Instabug.sdkDebugLogsLevel = .none and it works - I see no Instabug logs at all.

Kmohamed commented 3 years ago

Yes, none will prevent any Instabug logs, but the error will print error messages only.

algrid commented 3 years ago

Ok, not sure why .error prints those lines, but anyway .none is fine for me, thanks!