russell-archer/StoreHelper

How to disable logs?

Volodymyr-13 opened this issue Β· 3 comments

Greeting from Ukraine! πŸ‡ΊπŸ‡¦

@russell-archer Thank you for this amazing project!

I just started to use it and while creating a SwiftUI views, in debug I see enormous logs like:

Request products from the App Store started
Request products from the App Store success
Request all products purchase status started
Request products from the App Store success
Request all products purchase status started
Request all products purchase status success
Request all products purchase status success

Which is really mixing with all other logs for my debug..

So I wonder, is there way to disable such logs from StoreHelper?
Or maybe I'm doing something wrong if even in views where I'm not using StoreHelper I still see such logs..

Hi Volodymyr

Thanks for the kind words about StoreHelper - I'm really happy it's useful for you!

With regards to logging, you can somewhat reduce the amount of logging by setting StoreLog.logIsPurchasedEvents = false. For example:

struct StoreHelperDemoApp: App {
    @StateObject var storeHelper = StoreHelper()
    
    var body: some Scene {
        WindowGroup {
            MainView()
                .environmentObject(storeHelper)
                .task {
                    storeHelper.start()  // Start listening for transactions
                    StoreLog.logIsPurchasedEvents = false
                }
        }
    }
}

However, StoreHelper still produces quite a lot of logging!

As soon as I have some free time I'll add the ability to properly control the volume of logging!

Russell

Will not make these changes as I'm developing a more modern, lightweight StoreKit helper that is based around StoreKit Views. Details to follow.

@russell-archer Thats interesting, we actually used StoreHelper just as in-app framework, so any UI were done by us.
Looking forward for lightweight StoreKit helper! Ping me when it will be available and we definitely be a first testers) for our project.