JavaScriptConsoleCallback


public interface JavaScriptConsoleCallback


Can be associated with an isolate to receive and process console messages and events from it.

Summary

Nested types

Representation of a console message, such as produced by console.log.

Public methods

default void

Called when the console should notionally be cleared, such as through console.clear().

abstract void

Called when a console message is produced by the isolate, such as through console.log().

Public methods

onConsoleClear

Added in 1.0.0-beta01
default void onConsoleClear()

Called when the console should notionally be cleared, such as through console.clear().

The default implementation does nothing.

onConsoleMessage

Added in 1.0.0-beta01
abstract void onConsoleMessage(
    @NonNull JavaScriptConsoleCallback.ConsoleMessage message
)

Called when a console message is produced by the isolate, such as through console.log().

Do not rely on console messages for the transfer of large volumes of data. Overly large messages, stack traces, or source identifiers may be truncated.