WebView内のHTMLのconsole.logをLogCatに表示 – Android

いつもいちかばちかでやってた!

wv.setWebChromeClient(new WebChromeClient() {
    @Override
    public boolean onConsoleMessage(ConsoleMessage cm) {
        Log.d(TAG, "[" + cm.messageLevel() + "] " + cm.message() + " - " + cm.sourceId() + ":" + cm.lineNumber() + "行目");
        return true;
    }
});

wvはWebViewね!