Skip to content

Added information log about what's going on and -q to supress it. #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/kiplot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ def main():

parser = argparse.ArgumentParser(
description='Command-line Plotting for KiCad')
parser.add_argument('-v', '--verbose', action='store_true',
group = parser.add_mutually_exclusive_group()
group.add_argument('-v', '--verbose', action='store_true',
help='show debugging information')
group.add_argument('-q', '--quiet', action='store_true',
help='remove information logs')
parser.add_argument('-b', '--board-file', required=True,
help='The PCB .kicad-pcb board file')
parser.add_argument('-c', '--plot-config', required=True,
Expand All @@ -27,7 +30,11 @@ def main():

args = parser.parse_args()

log_level = logging.DEBUG if args.verbose else logging.INFO
log_level = logging.INFO
if args.verbose:
log_level = logging.DEBUG
if args.quiet:
log_level = logging.WARNING
logging.basicConfig(level=log_level)

if not os.path.isfile(args.board_file):
Expand Down
2 changes: 1 addition & 1 deletion src/kiplot/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _parse_output(self, o_obj):
raise self.YamlError("Output needs a name")

try:
desc = o_obj['description']
desc = o_obj['comment']
except KeyError:
desc = None

Expand Down
1 change: 1 addition & 0 deletions src/kiplot/kiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def plot(self, brd_file):
for op in self.cfg.outputs:

logging.debug("Processing output: {}".format(op.name))
logging.info('- %s (%s)' % (op.description,op.name))

# fresh plot controller
pc = pcbnew.PLOT_CONTROLLER(board)
Expand Down