Skip to content

Commit

Permalink
improve the readme and contributing guide (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: Hasan Ramezani <[email protected]>
  • Loading branch information
samuelcolvin and hramezani authored Apr 26, 2024
1 parent 2261c42 commit 13565fa
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,27 +1,34 @@
# 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)

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 @@ -36,10 +43,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 @@ -50,12 +56,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 @@ -64,6 +67,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 13565fa

Please sign in to comment.