logging techniques code example
Example 1: what do you use for logging
I use Log4J for logging.
I always log important steps in the test
execution. That helps me to debug
when there is a failure.
Log4J is not a replacement for HTML reports.
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j- core</artifactId>
<version>2.11.0</version>
</dependency>
Example 2: LOGGING
import logging
LOG_FILENAME = 'example.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
logging.debug('This message should go to the log file')