Checks for logging level. Logging level check moved to variable outside ...

for loop