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

Allow using pydantic plugin with models defined before calling logfire.configure #36

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

alexmojaki
Copy link
Contributor

So that e.g. this just works:

import os
import pydantic

os.environ['LOGFIRE_PYDANTIC_PLUGIN_RECORD'] = 'all'

class A(pydantic.BaseModel):
    a: str

import logfire
logfire.configure()

A(a='a')

Motivation: https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1714076434651649?thread_ts=1713995400.473799&cid=C06EDRBSAH3

Copy link

cloudflare-workers-and-pages bot commented Apr 29, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: e59e140
Status: ✅  Deploy successful!
Preview URL: https://10c96e81.logfire-docs.pages.dev
Branch Preview URL: https://alex-pydantic-plugin-env-var.logfire-docs.pages.dev

View logs

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@alexmojaki alexmojaki merged commit b5bd331 into main Apr 30, 2024
13 checks passed
@alexmojaki alexmojaki deleted the alex/pydantic-plugin-env-var branch April 30, 2024 10:07
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.

1 participant