[CLI] Added option to log a file
- This is in addition to logging to stderr. - This log is currently done with full debug information.
This commit is contained in:
parent
b2ffa5410a
commit
bb592a8ec4
|
|
@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
## [1.6.2] - UNRELEASED
|
||||
### Added
|
||||
- Command line:
|
||||
- Option to display a banner
|
||||
- `--banner N` Option to display a banner
|
||||
- `--log FILE` Option to log to a file, in addition to the stderr
|
||||
- Global options:
|
||||
- `colored_tht_resistors` to disable the 3D colored resistors.
|
||||
- `field_tolerance` field/s to look for resistor tolerance.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
Usage:
|
||||
kibot [-b BOARD] [-e SCHEMA] [-c CONFIG] [-d OUT_DIR] [-s PRE] [-D]
|
||||
[-q | -v...] [-C | -i | -n] [-m MKFILE] [-A] [-g DEF] ...
|
||||
[-q | -v...] [-L LOGFILE] [-C | -i | -n] [-m MKFILE] [-A] [-g DEF] ...
|
||||
[-E DEF] ... [-w LIST] [--banner N] [TARGET...]
|
||||
kibot [-v...] [-b BOARD] [-e SCHEMA] [-c PLOT_CONFIG] [--banner N]
|
||||
[-E DEF] ... --list
|
||||
|
|
@ -44,6 +44,8 @@ Options:
|
|||
-g DEF, --global-redef DEF Overwrite a global value (VAR=VAL)
|
||||
-i, --invert-sel Generate the outputs not listed as targets
|
||||
-l, --list List available outputs (in the config file)
|
||||
-L, --log LOGFILE Log to LOGFILE using maximum debug level.
|
||||
Is independent of what is logged to stderr
|
||||
-m MKFILE, --makefile MKFILE Generate a Makefile (no targets created)
|
||||
-n, --no-priority Don't sort targets by priority
|
||||
-p, --copy-options Copy plot options from the PCB file
|
||||
|
|
@ -74,6 +76,7 @@ Help options:
|
|||
--help-variants List supported variants and details
|
||||
|
||||
"""
|
||||
from datetime import datetime
|
||||
from glob import glob
|
||||
import gzip
|
||||
import locale
|
||||
|
|
@ -312,7 +315,14 @@ def main():
|
|||
# Set the specified verbosity
|
||||
GS.debug_enabled = log.set_verbosity(logger, args.verbose, args.quiet)
|
||||
log.debug_level = GS.debug_level = args.verbose
|
||||
logger.debug('KiBot {} verbose level: {}'.format(__version__, args.verbose))
|
||||
# We can log all the debug info to a separated file
|
||||
if args.log:
|
||||
if os.path.isfile(args.log):
|
||||
os.remove(args.log)
|
||||
log.set_file_log(args.log)
|
||||
GS.debug_level = 10
|
||||
# The log setup finished, this is our first log message
|
||||
logger.debug('KiBot {} verbose level: {} started on {}'.format(__version__, args.verbose, datetime.now()))
|
||||
apply_warning_filter(args)
|
||||
# Now we have the debug level set we can check (and optionally inform) KiCad info
|
||||
detect_kicad()
|
||||
|
|
|
|||
Loading…
Reference in New Issue