Complete the code to create a logger instance named 'logger'.
Logger logger = Logger.getLogger([1].class.getName());
The logger is usually named after the class where it is used. Here, 'TestSteps' is the class name.
Complete the code to log an info message 'Test started'.
logger.[1]("Test started");
Use the info method to log informational messages like test start.
Fix the error in the code to log a warning message 'Low disk space'.
logger.[1]("Low disk space");
The correct method to log a warning in Java's Logger is warn.
Fill both blanks to log an error with an exception message.
try { // test code } catch (Exception e) { logger.[1]("Error occurred: " + e.[2]()); }
Use error to log errors and getMessage() to get the exception message.
Fill all three blanks to log a debug message with the current test step number.
int step = 3; logger.[1]("Executing step " + [2] + ": " + [3]);
Use debug for detailed messages, the variable step for step number, and a string describing the step.
