getsentry / getsentry/sentry-python

Implement f-string parsing

オープン
#4,156 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Feature Logs Python
主要言語
Python
スター
2.2k
フォーク
669
平均マージ
1日 1時間
マージ済み PR(30日)
213

説明

Currently the logs API is like this:
```python
my_local_var=123
sentry_logging.warn("This is the value {val}", val=my_local_var)
```

This is very similar to Python f-string format, but not exactly the same. We also want to make this work in Sentry logging:

```python
my_local_var=123
sentry_logging.warn(f"This is the value {my_local_var}")
```

I we want to parse variables from f-strings here is how other libs do this:
- Take the frame https://github.com/pydantic/logfire/blob/d5243c3a17efe10a63206eada209c1c6105474be/logfire/_internal/main.py#L183
- And then uses `ast` to parse the f-string: https://github.com/pydantic/logfire/blob/d5243c3a17efe10a63206eada209c1c6105474be/logfire/_internal/formatter.py#L63

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。