able to toggle the logging state with the button