Logging toegevoegd
This commit is contained in:
@@ -3,9 +3,11 @@
|
|||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
import argparse
|
import argparse
|
||||||
|
import logging
|
||||||
from lmwsip import LmwSip
|
from lmwsip import LmwSip
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
|
logging.basicConfig(level=args.debug)
|
||||||
try:
|
try:
|
||||||
lmwsip = LmwSip(host=args.host, port=args.port,
|
lmwsip = LmwSip(host=args.host, port=args.port,
|
||||||
ssl=not args.unencrypted,
|
ssl=not args.unencrypted,
|
||||||
@@ -43,6 +45,9 @@ def main():
|
|||||||
parser.add_argument("-t", "--time", action='store',
|
parser.add_argument("-t", "--time", action='store',
|
||||||
default=lastTime["time_of_day"],
|
default=lastTime["time_of_day"],
|
||||||
help="Time replacement string [HH:MM]")
|
help="Time replacement string [HH:MM]")
|
||||||
|
parser.add_argument("-D", "--debug", action='store',
|
||||||
|
default="WARN",
|
||||||
|
help="Debug level")
|
||||||
parser.add_argument("files", type=argparse.FileType('r'), nargs="+",
|
parser.add_argument("files", type=argparse.FileType('r'), nargs="+",
|
||||||
help="Sip files to run")
|
help="Sip files to run")
|
||||||
run(parser.parse_args())
|
run(parser.parse_args())
|
||||||
|
Reference in New Issue
Block a user