-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use logging instead of prints #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can you update the logging format to make it so that the logs are machine parseable?
a2c3715
to
8aa345f
Compare
|
||
traceback.print_exc() | ||
log.error("Could not connect to PostgreSQL database server", exc_info=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be log.exception()
and then you don't need the additional param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe log -> logger, but change error to exception wherever we are in the handler
# What does this PR do? This PR moves all print statements to use logging. Things changed: - Had to add `await start_trace("sse_generator")` to server.py to actually get tracing working. else was not seeing any logs - If no telemetry provider is provided in the run.yaml, we will write to stdout - by default, the logs are going to be in JSON, but we expose an option to configure to output in a human readable way.
What does this PR do?
This PR moves all print statements to use logging. Things changed:
await start_trace("sse_generator")
to server.py to actually get tracing working. else was not seeing any logsTest Plan
json output:
human readable output: