Make Python logging, diagnostics and debug behavior depend on a debug/release execution flag.