function-buildpacks-for-knative
function-buildpacks-for-knative copied to clipboard
Can we make python buildpack log more quiet ?
Currently the python buildpack uses "print" to log. For example here https://github.com/vmware-tanzu/function-buildpacks-for-knative/blob/f37ccf933318d9e4c1cdc7c4a0d5b5e6b43a44e8/invokers/python/pyfunc/invoke.py#L72 and here https://github.com/vmware-tanzu/function-buildpacks-for-knative/blob/f37ccf933318d9e4c1cdc7c4a0d5b5e6b43a44e8/invokers/python/pyfunc/invoke.py#L60
As a result the console log is getting pretty messy. For example, this is a log output when sending a null cloud event response (which the return code is 200, but logs the entire stacktrace)
Sending raw result: tuple indices must be integers or slices, not str
Traceback (most recent call last):
File "/layers/tanzu-buildpacks_python-function/invoker/pyfunc/invoke.py", line 57, in handler
headers, body = cloudevents.http.to_binary(result, data_marshaller=smart_marshaller)
File "/layers/tanzu-buildpacks_python-function/invoker-deps/install/deprecation.py", line 260, in _inner
return function(*args, **kwargs)
File "/layers/tanzu-buildpacks_python-function/invoker-deps/install/cloudevents/http/http_methods.py", line 36, in to_binary
return _moved_to_binary(event, data_marshaller)
File "/layers/tanzu-buildpacks_python-function/invoker-deps/install/cloudevents/conversion.py", line 237, in to_binary
return _to_http(
File "/layers/tanzu-buildpacks_python-function/invoker-deps/install/cloudevents/conversion.py", line 191, in _to_http
if event["specversion"] not in _obj_by_version:
and if we configure liveness/readiness probe, the log gets polluted like the following.
App is ready)
App is ready)
App is live
App is ready)
App is live
App is ready)
App is live
App is ready)
App is live
App is ready)
App is live
App is ready)
App is liveApp is ready)
App is live
App is ready)
Feature Request
Set log levels debug and info