Made logging togglable.