Console
- class epyk.core.js.Js.JsConsole(page: Optional[PageModel] = None)
This is a wrapper to the Console.
Related Pages:
- property clear
The console.clear() method clears the console.
Usage:
page.js.console.clear
Related Pages:
- Returns:
The Javascript String used to clear the console (F12 in standard browsers).
- property debugger
Trigger a Javascript debugger from this point. The Javascript will be stopped. It will be possible to check the process step by step in the browser using F12.
Usage:
page.js.console.debugger
Related Pages:
- Returns:
The Javascript Keyword to trigger the browser debugger.
- error(data: Union[str, JsDataModel], js_conv_func: Optional[Union[list, str]] = None)
The console.error() method writes an error message to the console.
Related Pages:
- Parameters:
data – The Javascript fragment
js_conv_func – Optional. A specific JavaScript data conversion function
- Returns:
The Javascript String used to clear the console (F12 in standard browsers)
- info(data: Union[str, JsDataModel], js_conv_func: Optional[Union[list, str]] = None)
The console.info() method writes a message to the console.
Related Pages:
- Parameters:
data – The Javascript fragment
js_conv_func – Optional. A specific JavaScript data conversion function
- Returns:
The Javascript String used to clear the console (F12 in standard browsers)
- log(data: Union[str, JsDataModel], js_conv_func: Optional[Union[list, str]] = None, skip_data_convert: bool = False)
The console.log() method writes a message to the console.
Usage:
page.js.console.log("Test")
Related Pages:
- Parameters:
data – The Javascript fragment.
js_conv_func – Optional. A specific JavaScript data conversion function.
skip_data_convert – Optional. Flag to specify to the framework if a Json conversion is needed.
- Returns:
The Javascript String used to clear the console (F12 in standard browsers)
- perf(js_code: str, label: Optional[str] = None)
Shortcut function to display performances from a variable. The variable must be global. Namely the name should start with window.
- Parameters:
js_code – The variable var name use to compute the performance.
label – Optional. The description.
- service(msg: str, headers: Optional[dict] = None)
Send logs to the backend.
- Parameters:
msg – The log message to be sent to the backend
headers – the service headers
- table(data: Union[str, JsDataModel], js_header: Optional[list] = None) JsFunction
The console.table() method writes a table in the console view.
Related Pages:
- Parameters:
data – The data to fill the table with
js_header – Optional. An array containing the names of the columns to be included in the table
- Returns:
The Javascript String used to clear the console (F12 in standard browsers).
- time(html_code: Union[str, JsDataModel]) JsNumber
The console.time() method starts a timer in the console view.
Related Pages:
- Parameters:
html_code – Use the label parameter to give the timer a name
- Returns:
A Python Javascript Number.
- timeEnd(html_code: Union[str, JsDataModel])
The console.timeEnd() method ends a timer, and writes the result in the console view.
Related Pages:
- Parameters:
html_code – The name of the timer to end
- Returns:
The Javascript String used to clear the console (F12 in standard browsers).
- tryCatch(js_funcs: Union[str, list], js_funcs_errs: Union[str, list] = 'console.warn(err.message)', profile: Optional[Union[bool, dict]] = False)
Javascript Try Catch Exceptions.
Related Pages:
- Parameters:
js_funcs – The Javascript functions
js_funcs_errs – The Javascript functions
profile – Optional. A flag to set the component performance storage
- Returns:
The Javascript String used to clear the console (F12 in standard browsers)
- warn(data: Union[str, JsDataModel], js_conv_func: Optional[Union[list, str]] = None)
The console.warn() method writes a warning to the console.
Related Pages:
- Parameters:
data – The Javascript fragment
js_conv_func – Optional. A specific JavaScript data conversion function
- Returns:
The Javascript String used to clear the console (F12 in standard browsers)