wttech / aet

AET - a system that detects visual changes on web sites and performs basic page health checks
https://wttech.blog/open-source/
Apache License 2.0
146 stars 49 forks source link

Entire codesniffer JS source file is written to logs for each accessibility collect #446

Closed tkaik closed 5 years ago

tkaik commented 5 years ago

Describe the bug When using the accessibility collector in a suite, the entire codesniffer JS source file is written to logs for each accessibility collection. This happens only in the DEBUG logs level - however this should not happen even on this level - this JS file contains few thousands lines of code.

CC @plutasnyy

To Reproduce Steps to reproduce the behavior:

  1. Make sure that the Logger on your AET environement (karaf) is set to DEBUG mode
  2. Prepare a suite XML with a test using accessibility collector.
  3. Run the suite
  4. View the worker.log file - see the entry starting with <time> | DEBUG | com.cognifide.aet.jobs | JavaScriptJobExecutor 51 | Executing JavaScript command: /* followed by the whole source of htmlcs.js file

Expected behavior Option 1 - When writing the JS code snippet to the log file, it's length should be limited to some reasonable value (e.g. first 100 characters). Option 2 -The Accessibility collector should not log the content of executed JS file at all

malaskowski commented 5 years ago

We had already short chat about that with @plutasnyy My suggestion is to: 1) Change log level in JavaScriptJobExecutor.executeJs to TRACE (trace is a good level to log such details). 2) Add separate DEBUG level logs in every collector/modifier that calls JavaScriptJobExecutor.executeJs that will say something like:

Executing MODIFIER_NAME ...