WebView Logger
A WebView Logger get the logs from console without using chrome://inspect.
Usage
For the application which is use WebView when its reach to the client inorder to find bugs and resolve fix. WVL save the log in device it can be view as separete and as well send log in mail.
Notable usage
- View Logs from webview
- Send logs to mail
Implementation
Add below line in Project.gradle
repositories {
//... other repos
maven {
url "https://dl.bintray.com/arulmani/WebKit"
}
}
Add below line in App.gradle under Dependecy section
implementation 'com.arul.webkit:wvl:1.0.4'
That's it sync the project.
Configurations
We can configure mail and cache size of log tobe store.
Add below line in strings.xml
.
<string name="wvl_report_email">sample@mail.com</string>
<string name="wvl_log_cache_size">20</string>
Adding webchrome client for webview follow below implementation
webview.settings.apply {
javaScriptEnabled = true
}
// wvl implementation
webview.webChromeClient = object : WebViewLogger(application = application) {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?, section: String) {
super.onConsoleMessage(consoleMessage, section)
}
}
webview.loadUrl("https://dev.to")
Screen shots
When install your webview application wvl launcher icon also added into launcher screen like below spcified.
Open WVL first then open webview logger to get listen to latest logs.
WVL view
Application(Load sample web site in webview)
Click on send icon to send logs to mail that you configured.
Contact
If you have any questions or comments about this component, or need help using it, please either raise an issue or email Support.