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

Can we make python buildpack log more quiet ? #174

@mhoshi-vm

Description

@mhoshi-vm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions