Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| development:python [2023/09/19 13:38] – [Execute Bash command and capture output] Zyzonix | development:python [2024/02/27 07:32] (current) – Zyzonix | ||
|---|---|---|---|
| Line 52: | Line 52: | ||
| return mailText | return mailText | ||
| - | def sendMail(self, hosts, awakeList, failedList, statusUnknownList): | + | def sendMail(self): |
| if EMAILRECEIVER and EMAILSENDER and MAILSERVER and MAILSERVERPORT: | if EMAILRECEIVER and EMAILSENDER and MAILSERVER and MAILSERVERPORT: | ||
| import smtplib | import smtplib | ||
| Line 65: | Line 65: | ||
| msgRoot = MIMEMultipart(" | msgRoot = MIMEMultipart(" | ||
| msgRoot[' | msgRoot[' | ||
| - | msgRoot[' | + | msgRoot[' |
| msgRoot[' | msgRoot[' | ||
| - | mailContent = MIMEText(wakeup.buildMail(self)) | + | mailContent = MIMEText(buildMail(self)) |
| mailText = MIMEText(mailContent, | mailText = MIMEText(mailContent, | ||
| msgRoot.attach(mailText) | msgRoot.attach(mailText) | ||
| Line 119: | Line 119: | ||
| | | ||
| | | ||
| - | mailContent = wakeup.buildMail(self) | + | mailContent = buildMail(self) |
| mailText = MIMEText(mailContent, | mailText = MIMEText(mailContent, | ||
| | | ||
| Line 127: | Line 127: | ||
| | | ||
| except: | except: | ||
| - | | + | |
| - | | + | |
| | | ||
| else: | else: | ||
| - | | + | |
| </ | </ | ||
| ++++ | ++++ | ||
| Line 157: | Line 157: | ||
| ++++ | ++++ | ||
| </ | </ | ||
| + | |||
| + | ==== FastAPI/ | ||
| + | === Change Log Format === | ||
| + | Adding the following lines to your '' | ||
| + | <code bash> | ||
| + | log_config = uvicorn.config.LOGGING_CONFIG | ||
| + | log_config[" | ||
| + | uvicorn.run(app, | ||
| + | </ | ||
| + | |||
| + | //Sourced from [[https:// | ||