vespa-engine / pyvespa

Python API for https://vespa.ai, the open big data serving engine
https://pyvespa.readthedocs.io/
Apache License 2.0
80 stars 24 forks source link

Verbose pyvespa #297

Closed kkraune closed 2 years ago

kkraune commented 2 years ago

debugging pyvespa pipeline problems is easier in a verbose mode where responses from select operations are output to stdout (results from requests, etc).

Maybe an env var or something to enable

thigm85 commented 2 years ago

Could you give a concrete example of the desired behavior?

kkraune commented 2 years ago

I am thinking about debug logging, that is default off, but can easily be enabled like:

        if os.getenv("PYVESPA_DEBUG") == "true":
            logging.basicConfig(level=logging.DEBUG)

so in the pyvespa code we can use:

 logging.debug("Config Server check:" + output)

when debugging SD job failures, we can just add to screwdriver.yaml:

export PYVESPA_DEBUG=true

and we get debug log not only from pyvespa code but other libraries. This has already helped me find one bug

thigm85 commented 2 years ago

Make sense, logging is indeed missing from pyvespa.

kkraune commented 2 years ago

some files are now using debug logging since pyvespa 0.17.0, enable using by setting PYVESPA_DEBUG=true in the environment or %env PYVESPA_DEBUG=true in notebooks

https://github.com/vespa-engine/pyvespa/blob/master/vespa/deployment.py#L70