Hey! Is it possible to print logs while using Prev...
# compose
a
Hey! Is it possible to print logs while using Previews especially Interactive Previews?
c
It is not as Interactive Preview is running in a sandbox that is not the same as running on device. You can always deploy specific Previews to device, which you can then see your print statements working.
👍 1
m
@Ankur Gupta what i’ve been doing is deploying the preview to an emulator, and using a DisposableEffect to setup timber within the function annotated with @Preview
Copy code
DisposableEffect(key1 = true) {
            Timber.plant(Timber.DebugTree())
            onDispose { 
                Timber.uprootAll()
            }
        }
👍 1
a
Thanks guys, it's helpful!