only log if logging is enabled