Kermit
Kermit copied to clipboard
Kermit default Logger crashes in Android Unit Test
By default, the LogcatWriter is used on Android. This will crash on Android unit tests, since the android.util.Log class is not mocked. The workaround is to setup the CommonLogger in every test, which is easy to forget about.
It would be nice to separately have an AndroidWriter that will check if running in unit tests, and delegate to LogcatWriter if running in the app, and CommonWriter if running in test. This would prevent adding complexity to existing LogcatWriter, while avoiding pushing extra responsibility to users.
Related with: https://github.com/touchlab/Kermit/issues/184