Add ability to enable debug logging by commandline argument
This commit is contained in:
parent
16387a3f50
commit
895a5aa37f
1 changed files with 4 additions and 0 deletions
|
@ -14,7 +14,11 @@ def launch_server():
|
|||
parser.add_argument('-c', action='store', dest='config', help='Station configuration', default=None)
|
||||
parser.add_argument('-l', action='store', dest='address', help='Listen address', default='0.0.0.0')
|
||||
parser.add_argument('-p', action='store', dest='port', type=int, help='Listen port', default=80)
|
||||
parser.add_argument('-d', action='store_true', dest='debug', help='Enable debug logging')
|
||||
arguments = parser.parse_args()
|
||||
if arguments.debug:
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
logging.debug("Debug logging enabled")
|
||||
logging.info("YCast server starting on %s:%s" % (arguments.address, arguments.port))
|
||||
server.run(arguments.config, arguments.address, arguments.port)
|
||||
|
||||
|
|
Loading…
Reference in a new issue