Skip to content

Commit

Permalink
Merge branch 'main' into classifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani authored Apr 26, 2024
2 parents 20168e3 + 13565fa commit 9a0f031
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We'd love anyone interested to contribute to the Logfire SDK and documentation.

1. Fork and clone the repository
2. [Install Rye](https://rye-up.com/guide/basics/)
3. Run `make install` this will install necessary dependencies
3. Run `make install` to install dependencies
4. Run `make test` to run unit tests
5. Run `make format` to format code
6. Run `make lint` to lint code
Expand Down
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
# Logfire — Uncomplicated Observability
# Pydantic Logfire — Uncomplicated Observability

[![CI](https://github.com/pydantic/logfire/actions/workflows/main.yml/badge.svg?event=push)](https://github.com/pydantic/logfire/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![pypi](https://img.shields.io/pypi/v/logfire.svg)](https://pypi.python.org/pypi/logfire)
[![license](https://img.shields.io/github/license/pydantic/logfire.svg)](https://github.com/pydantic/logfire/blob/main/LICENSE)
[![downloads](https://static.pepy.tech/badge/logfire/month)](https://pepy.tech/project/logfire)
[![versions](https://img.shields.io/pypi/pyversions/logfire.svg)](https://github.com/pydantic/logfire)

Logging and more like you always hoped it would be.
Logging like you always hoped it would be.

See the [documentation](https://docs.pydantic.dev/logfire/) for more information.

**Feel free to report issues and ask questions about `logfire` in this repository!**
**Feel free to report issues and ask any questions about Logfire in this repository!**

This repo contains the Python SDK for `logfire` and documentation, the server application for recording and displaying data is closed source.

## Installation
## Setup

Install:
```bash
pip install logfire
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/first_steps/?h=install#install)
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/first_steps/#install)

Authenticate:
```bash
logfire auth
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/first_steps/#authentication)

## Usage

Very simple logging/tracing example:
Here's a simple manual tracing (aka logging) example:

```python
import logfire
Expand All @@ -38,10 +45,9 @@ with logfire.span('Asking the user their {question}', question='age'):
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/onboarding_checklist/03_add_manual_tracing/)

Or you can avoid manual instrumentation and instead integrate with [lots of popular packages](https://github.com/samuelcolvin?tab=repositories), here's an example of integrating with FastAPI:
Or you can also avoid manual instrumentation and instead integrate with [lots of popular packages](https://docs.pydantic.dev/logfire/integrations/), here's an example of integrating with FastAPI:

```py
from datetime import date
import logfire
from pydantic import BaseModel
from fastapi import FastAPI
Expand All @@ -52,12 +58,9 @@ logfire.configure()
logfire.instrument_fastapi(app)
# next, instrument your database connector, http library etc. and add the logging handler


class User(BaseModel):
name: str
country_code: str
dob: date


@app.post('/')
async def add_user(user: User):
Expand All @@ -66,6 +69,10 @@ async def add_user(user: User):
```
[_(learn more)_](https://docs.pydantic.dev/logfire/integrations/fastapi/)

Logfire gives you a view into how your code is running like this:

![Logfire screenshot](https://docs.pydantic.dev/logfire/images/index/logfire-screenshot-fastapi-200.png)

## Contributing

We'd love anyone interested to contribute to the Logfire SDK and documentation, see the [contributing guide](./CONTRIBUTING.md).
Expand Down

0 comments on commit 9a0f031

Please sign in to comment.