Enable Logging
By default, Edgemesh® Client has a minimal logging level that only logs error events to the console. However, enabling more comprehensive logging can be beneficial for understanding the control flow between Edgemesh® Client (Service Worker) and the page's rendering engine.
Edgemesh® Client supports five levels of logging:
- DEBUG: Displays all logs, including trace level and context, in the console.
- LOG: Displays info, warning, and error logs in the console.
- WARN: Displays only warning and error logs in the console.
- ERROR: Displays only error logs in the console.
- SILENT: Disables logging (default).
The log levels are defined as an enumeration called LogLevels
in the edgemesh namespace. You can set the logging level using the setLogLevel method, which accepts either the numeric or string value of the log level.
To enable logging, use the setLogLevel method in the developer tools JavaScript console, setting it to the desired log level value.
Once the logging level is set, you will start seeing logs in the console based on the configured level.
Enabling more extensive logging can help illustrate the control flow and provide insights into the interactions between Edgemesh® Client and the page's rendering engine. It can be particularly useful for debugging and troubleshooting purposes.