add --warn CLI option to reduce logging

This commit is contained in:
Desuuuu 2020-11-23 00:10:57 +01:00
parent e5437b7c69
commit 4308635022
No known key found for this signature in database
GPG Key ID: 85943F4B2C2CE0DC
2 changed files with 9 additions and 2 deletions

View File

@ -18,8 +18,11 @@ Klipper is Free Software. See the [license](COPYING) or read the
## Modifications ## Modifications
The scope of modifications is limited to adding support for DWIN T5UID1 The scope of modifications is limited to adding support for DWIN T5UID1
touchscreens. This feature is only available for AVR/LPC176X touchscreens (except for the addition of a --warn CLI option, which sets the
micro-controllers and it needs to be configured before compilation. logging level to WARNING).
The touchscreen feature is only available for AVR/LPC176X micro-controllers and
it needs to be configured before compilation.
The touchscreen firmware compatible with this fork is available in The touchscreen firmware compatible with this fork is available in
[this repository](https://github.com/Desuuuu/DGUS-reloaded-Klipper). [this repository](https://github.com/Desuuuu/DGUS-reloaded-Klipper).

View File

@ -266,6 +266,8 @@ def main():
help="write log to file instead of stderr") help="write log to file instead of stderr")
opts.add_option("-v", action="store_true", dest="verbose", opts.add_option("-v", action="store_true", dest="verbose",
help="enable debug messages") help="enable debug messages")
opts.add_option("--warn", action="store_true", dest="warn",
help="reduce logging to warnings")
opts.add_option("-o", "--debugoutput", dest="debugoutput", opts.add_option("-o", "--debugoutput", dest="debugoutput",
help="write output to file instead of to serial port") help="write output to file instead of to serial port")
opts.add_option("-d", "--dictionary", dest="dictionary", type="string", opts.add_option("-d", "--dictionary", dest="dictionary", type="string",
@ -280,6 +282,8 @@ def main():
debuglevel = logging.INFO debuglevel = logging.INFO
if options.verbose: if options.verbose:
debuglevel = logging.DEBUG debuglevel = logging.DEBUG
elif options.warn:
debuglevel = logging.WARNING
if options.debuginput: if options.debuginput:
start_args['debuginput'] = options.debuginput start_args['debuginput'] = options.debuginput
debuginput = open(options.debuginput, 'rb') debuginput = open(options.debuginput, 'rb')