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
4 months agoShaun
4 months agoKaran
5 months agoRefugia
5 months agoGabriele
5 months agoBulah
5 months agoThora
5 months agoEllen
6 months agoIvette
6 months agoMarya
6 months agoKing
6 months agoMitzie
6 months agoMalcom
7 months agoCarmen
1 year agoJeff
12 months agoCeleste
12 months agoEmogene
1 year agoMaira
1 year agoBrice
1 year agoShala
1 year agoMalcom
1 year agoMalinda
1 year agoGalen
1 year agoDean
1 year agoGail
1 year agoSunshine
1 year agoChu
1 year agoJesus
1 year agoFrance
1 year agoArt
1 year agoCelia
1 year agoLaurel
1 year agoDong
1 year agoWerner
1 year ago