Improved logger. Log messages are created only for selected log levels.