I am developing web test scripts with Selenium WebDriver + Java, following the POM design pattern, and using Log4j2 for logging purposes.
Currently, my page methods are set up like so:
public void clickButton(){
Log.debug("Clicking button...");
btn.click();
Log.info("Clicked button");
}
with a log line generated at the debug level before the action is performed, and an entry logged at the info level afterwards.
However, after thinking about it, I am not sure that there is much point to the debug log beforehand, because if an action were to fail, I would immediately be able to pinpoint the issue by the info logs even without going to the debug level. Am I gaining much by including it or am I safe to remove it?