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

Python - 日誌 (logging) 模組 | Titangene Blog #64

Open
titangene opened this issue Oct 26, 2021 · 0 comments
Open

Python - 日誌 (logging) 模組 | Titangene Blog #64

titangene opened this issue Oct 26, 2021 · 0 comments

Comments

@titangene
Copy link
Owner

https://titangene.github.io/article/python-logging.html#comments

開發 Python 時,很常使用 print() 來輸出變數以方便 debug,但要部署時,不需要這些訊息,需要自己手動去註解或刪除那些放在各處的 print()。而 Python 內建提供了 logging 模組可以用來取代 print(),logging 除了可以輸出訊息,也可以將訊息儲存至日誌檔保存。下面紀錄如何使用 logging 模組。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant