Skip to content

Commit 99be90d

Browse files
committed
[ADD] [SQUASH] Initial login.
1 parent beb009e commit 99be90d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

yamq/server.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import argparse
22
import asyncio
3+
import logging
34
import os
45
from functools import partial
56

6-
77
import subject
88
import stomp
99
import observer
@@ -127,7 +127,7 @@ def connection_lost(self, exc):
127127
type=str,
128128
nargs="?",
129129
default="localhost",
130-
help=("Host name on which the server will bind to.")
130+
help="Host name on which the server will bind to."
131131
)
132132
parser.add_argument(
133133
"-p", "--port",
@@ -138,12 +138,20 @@ def connection_lost(self, exc):
138138
"Port number on which the server will listen for incoming requests."
139139
)
140140
)
141+
parser.add_argument(
142+
"-l", "--log",
143+
type=str,
144+
nargs='?',
145+
default="DEBUG",
146+
choices= ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "NOTSET"],
147+
help="Decide the level of log the application should throw."
148+
)
141149
args = parser.parse_args()
142150
event_loop = asyncio.get_event_loop()
143151
coro = event_loop.create_server(STOMP_Server, args.host, args.port)
144152
server = event_loop.run_until_complete(coro)
145153

146-
print("Server started on {}:{}".format(args.host, args.port))
154+
logging.info("Server started on {}:{}".format(args.host, args.port))
147155

148156
try:
149157
event_loop.run_forever()

0 commit comments

Comments
 (0)