Search in sources :

Example 6 with Formatter

use of com.gargoylesoftware.htmlunit.WebConsole.Formatter in project htmlunit by HtmlUnit.

the class Console method error.

/**
 * This method performs logging to the console at {@code error} level.
 * @param cx the JavaScript context
 * @param thisObj the scriptable
 * @param args the arguments passed into the method
 * @param funObj the function
 */
@JsxFunction
public static void error(final Context cx, final Scriptable thisObj, final Object[] args, final Function funObj) {
    final WebConsole webConsole = toWebConsole(thisObj);
    final Formatter oldFormatter = webConsole.getFormatter();
    webConsole.setFormatter(FORMATTER_);
    webConsole.error(args);
    webConsole.setFormatter(oldFormatter);
}
Also used : WebConsole(com.gargoylesoftware.htmlunit.WebConsole) Formatter(com.gargoylesoftware.htmlunit.WebConsole.Formatter) JsxFunction(com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction)

Aggregations

WebConsole (com.gargoylesoftware.htmlunit.WebConsole)6 Formatter (com.gargoylesoftware.htmlunit.WebConsole.Formatter)6 JsxFunction (com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction)6 RhinoException (net.sourceforge.htmlunit.corejs.javascript.RhinoException)1