Make logging level based

In production mode you generally want to errors to be logged but ignore info/debug messages. This simple patch achieves that by allowing to set `debug_mode` to string "error" (or "info") while maintaining backwards compatibility with existing behavior of all or nothing approach.