Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Can we make python buildpack log more quiet ? #174

Open
mhoshi-vm opened this issue Feb 16, 2023 · 0 comments
Open

Can we make python buildpack log more quiet ? #174

mhoshi-vm opened this issue Feb 16, 2023 · 0 comments

Comments

@mhoshi-vm
Copy link

Currently the python buildpack uses "print" to log.
For example
here


and
here
print(f"Sending raw result: {e}")

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

Describe alternatives you've considered

Additional context

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant