mirror of https://github.com/Desuuuu/klipper.git
console: Add option to enable debug output mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
3c6eb376ac
commit
5f80c84309
|
@ -204,6 +204,8 @@ class KeyboardReader:
|
||||||
def main():
|
def main():
|
||||||
usage = "%prog [options] <serialdevice>"
|
usage = "%prog [options] <serialdevice>"
|
||||||
opts = optparse.OptionParser(usage)
|
opts = optparse.OptionParser(usage)
|
||||||
|
opts.add_option("-v", action="store_true", dest="verbose",
|
||||||
|
help="enable debug messages")
|
||||||
opts.add_option("-b", "--baud", type="int", dest="baud", help="baud rate")
|
opts.add_option("-b", "--baud", type="int", dest="baud", help="baud rate")
|
||||||
options, args = opts.parse_args()
|
options, args = opts.parse_args()
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
|
@ -215,7 +217,11 @@ def main():
|
||||||
or serialport.startswith("/tmp/")):
|
or serialport.startswith("/tmp/")):
|
||||||
baud = 250000
|
baud = 250000
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
debuglevel = logging.INFO
|
||||||
|
if options.verbose:
|
||||||
|
debuglevel = logging.DEBUG
|
||||||
|
logging.basicConfig(level=debuglevel)
|
||||||
|
|
||||||
r = reactor.Reactor()
|
r = reactor.Reactor()
|
||||||
kbd = KeyboardReader(r, serialport, baud)
|
kbd = KeyboardReader(r, serialport, baud)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue