Make logging optional to fix lag