Add a debug option

Makes it possible to enable/disable debug logging.