agronholm / agronholm/sqlacodegen

Use logging instead of print for informational statements

オープン
#451 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
2.4k
フォーク
284
平均マージ
2日 1時間
マージ済み PR(30日)
1

説明

### Things to check first

- [x] I have searched the existing issues and didn't find my feature already requested there

### Feature description

https://github.com/agronholm/sqlacodegen/blob/615d79c6f6fdcb776c891179eb46516b1e8fd6f5/src/sqlacodegen/cli.py#L143 defaults to using stdout but the print statements above corrupt the stdout file by printing a bunch of logging statements

https://github.com/agronholm/sqlacodegen/blob/615d79c6f6fdcb776c891179eb46516b1e8fd6f5/src/sqlacodegen/cli.py#L94-L129

Instead, there should be a way to configure Logging to redirect the `print` statements to somewhere else (or suppress them altogether!)

### Use case

1. `sqlacodegen` command which redirects stdout to a generated file (ex: from a docker exec command)
2. Do anything which causes one of the `print` statements to fire, like use pgvector.

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

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

評価

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

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

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