Making logging optional