Skip to content
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

Add log compatibility #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add log compatibility #246

wants to merge 1 commit into from

Conversation

Crazytieguy
Copy link

@Crazytieguy Crazytieguy commented Jul 23, 2024

See https://docs.rs/tracing/latest/tracing/#emitting-log-records.
Would be helpful for use in python extension crates that want to use pyo3-log

@64bit
Copy link
Owner

64bit commented Jul 24, 2024

Thank you for the PR!

Shouldn't this be a feature flag in https://github.com/64bit/async-openai/blob/main/async-openai/Cargo.toml#L15-L24 to opt in explicitly? May be tracing-log = [ "tracing/log" ]

Since the library is not using the feature flag directly, it doesn't need to be enabled by default. Open to hear why you'd like to enable it by default?

@Crazytieguy
Copy link
Author

Oh, that sounds reasonable actually. Although in that case maybe tracing itself should also be enabled by a feature? I tried looking for examples in libraries I expected to have something like this, but apparently they don't have a way to enable tracing-log either. I wonder if I'm missing something.

Anyway it's your decision of course

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

Successfully merging this pull request may close these issues.

2 participants