Package org.htmlunit

# Class WebConsole

java.lang.Object
org.htmlunit.WebConsole

All Implemented Interfaces:
  `Serializable`, `org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter`

public class WebConsole extends Object implements org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter, Serializable
This class can be used to print messages to the logger. The first parameter can be a message-object containing format specifiers such as ("%o", "%s", "%d", "%i", "%f"). The logging methods are null-safe, so if the number of format specifiers and the numbers of parameters don't match, no exception is thrown.

The default logger uses Apache Commons Logging.

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `WebConsole.Logger`
  A simple logging interface abstracting logging APIs.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebConsole()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `WebConsole.Logger`
  `getLogger()`
  Returns the current Logger.
  `void`
  `print(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.NativeConsole.Level level, Object[] args, org.htmlunit.corejs.javascript.ScriptStackElement[] stack)`
  `void`
  `setLogger(WebConsole.Logger logger)`
  Sets the Logger_.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WebConsole

    public WebConsole()

- ## Method Details

  - ### setLogger

    public void setLogger(WebConsole.Logger logger)
    Sets the Logger_.
    Parameters:
      `logger` - the logger

  - ### getLogger

    public WebConsole.Logger getLogger()
    Returns the current Logger.
    Returns:
      the logger

  - ### print

    public void print(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.NativeConsole.Level level, Object[] args, org.htmlunit.corejs.javascript.ScriptStackElement[] stack)
    Specified by:
      `print` in interface `org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter`