8000 Add some debug logs · python/webhook-mailer@e4432d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e4432d7

Browse files
committed
Add some debug logs
1 parent 35c814b commit e4432d7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mailer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ async def fetch_diff(client, url):
8181
async def send_email(smtp, message):
8282
async with smtp as server:
8383
await server.connect()
84+
print('Login:', SMTP_USERNAME, SMTP_PASSWORD)
8485
await server.login(SMTP_USERNAME, SMTP_PASSWORD)
8586
return (await server.send_message(message))
8687

@@ -129,11 +130,7 @@ async def handler(request):
129130
return handler
130131

131132

132-
def application(loop=None, smtp=None):
133-
if loop is None:
134-
loop = asyncio.get_event_loop()
135-
if smtp is None:
136-
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop, use_tls=False)
133+
def application(loop, smtp):
137134
app = aiohttp.web.Application(loop=loop)
138135
app.router.add_post('/', create_handler(
139136
lambda: aiohttp.ClientSession(loop=loop),
@@ -144,5 +141,6 @@ def application(loop=None, smtp=None):
144141
if __name__ == '__main__':
145142
loop = asyncio.get_event_loop()
146143
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop, use_tls=False)
144+
print('SMTP:', SMTP_HOSTNAME, SMTP_PORT)
147145
app = application(loop, smtp)
148146
aiohttp.web.run_app(app, port=PORT)

0 commit comments

Comments
 (0)
0