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
The scope of modifications is limited to adding support for DWIN T5UID1
touchscreens. This feature is only available for AVR/LPC176X
micro-controllers and it needs to be configured before compilation.
touchscreens (except for the addition of a --warn CLI option, which sets the
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
[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")
opts.add_option("-v", action="store_true", dest="verbose",
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",
help="write output to file instead of to serial port")
opts.add_option("-d", "--dictionary", dest="dictionary", type="string",
@ -280,6 +282,8 @@ def main():
debuglevel = logging.INFO
if options.verbose:
debuglevel = logging.DEBUG
elif options.warn:
debuglevel = logging.WARNING
if options.debuginput:
start_args['debuginput'] = options.debuginput
debuginput = open(options.debuginput, 'rb')