I feel like I might be mixing up the log levels. I know WARN should log WARN and ERROR, but I can't remember if INFO is included. A seems likely, but I’m not completely confident.
I practiced a similar question, and I think only the WARN and ERROR messages would be captured. A seems like the right choice, but I'm still a bit confused.
I've got a strategy for this. Since the log level is set to WARN, only messages at the WARN level or higher (i.e., ERROR) will be logged. So the answer should be A - both the WARN and ERROR messages will be written to the log.
I'm a bit confused on this one. The code is using the "products" logger, but the active log category is "root". Does that mean the "products" logger will still be affected by the "root" log level? I'll need to double-check the logging framework documentation.
Okay, let's see here. The active log category is "root" and the log level is set to WARN. So I'm thinking only the warn and error messages will be logged, not the info message.
Ah, I see what's going on here. Since the log level is set to WARN, the 'log.warn' message will be written, but the 'log.error' message will be suppressed. So the answer is A.
Haha, I bet the answer is C. Imagine the poor developer who has to debug this code, they're gonna be scratching their heads like 'Wait, why is the info message being logged instead of the warn message?'
Wait, what? The code is using 'Logger.getLogger('products')', but the log level is set to 'root'. Shouldn't it be checking the log level for the 'products' logger instead? This is a tricky one.
Wait, what? The code is using 'Logger.getLogger('products')', but the log level is set to 'root'. Shouldn't it be checking the log level for the 'products' logger instead?
Well, the question states that the log level is set to WARN, so I would expect to see the 'log.warn' message, but not the 'log.error' message. I guess option A is the correct answer.
Audry
2 months agoShaun
3 months agoKaran
3 months agoRefugia
3 months agoGabriele
3 months agoBulah
3 months agoThora
4 months agoEllen
4 months agoIvette
4 months agoMarya
4 months agoKing
4 months agoMitzie
5 months agoMalcom
5 months agoCarmen
11 months agoJeff
10 months agoCeleste
10 months agoEmogene
10 months agoMaira
11 months agoBrice
10 months agoShala
10 months agoMalcom
10 months agoMalinda
11 months agoGalen
11 months agoDean
12 months agoGail
12 months agoSunshine
12 months agoChu
11 months agoJesus
11 months agoFrance
11 months agoArt
12 months agoCelia
11 months agoLaurel
11 months agoDong
11 months agoWerner
11 months ago