Added check for debug mode. Otherwise logger is disabled.