Package com.vaadin.client
Class Console
java.lang.Object
com.vaadin.client.Console
Helper class for using window.console. Does not log anything except
JavaScript exception traces to console if production mode is enabled.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidIf not in production mode, logs the given message to the browser console using the debug log level.static voidIf not in production mode, logs the given message to the browser console using the error log level.static voidIf not in production mode, logs the given message to the browser console using the info log level.static voidreportStacktrace(Exception exception) Logs the stacktrace of an exception to the browser console.static voidsetProductionMode(boolean isProductionMode) Changes logger behavior, making it skip all browser logging for production mode.static voidIf not in production mode, logs the given message to the browser console using the warning log level.
-
Method Details
-
setProductionMode
public static void setProductionMode(boolean isProductionMode) Changes logger behavior, making it skip all browser logging for production mode.- Parameters:
isProductionMode- if an application is in the production mode or not
-
debug
If not in production mode, logs the given message to the browser console using the debug log level.If used directly in a JVM, writes the message to standard output disregarding of the production mode settings.
- Parameters:
message- the message to log
-
log
If not in production mode, logs the given message to the browser console using the info log level.If used directly in a JVM, writes the message to standard output disregarding of the production mode settings.
- Parameters:
message- the message to log
-
warn
If not in production mode, logs the given message to the browser console using the warning log level.If used directly in a JVM, writes the message to standard error disregarding of the production mode settings.
- Parameters:
message- the message to log
-
error
If not in production mode, logs the given message to the browser console using the error log level.If used directly in a JVM, writes the message to standard error disregarding of the production mode settings.
- Parameters:
message- the message to log
-
reportStacktrace
Logs the stacktrace of an exception to the browser console. Logging is done asynchronously since that approach allows reporting it with highest possible fidelity.- Parameters:
exception- the exception for which
-