Skip to content

Commit

Permalink
change --slog to use nargs
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksville committed Jul 3, 2024
1 parent ae2ef78 commit 5695ec7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,10 @@ def setSimpleConfig(modem_preset):
qr = pyqrcode.create(url)
print(qr.terminal())

if args.slog_out or args.power_stress:
if args.slog or args.power_stress:
# Setup loggers
global meter # pylint: disable=global-variable-not-assigned
LogSet(interface, args.slog_out if args.slog_out != 'default' else None, meter)
LogSet(interface, args.slog if args.slog != 'default' else None, meter)

Check warning on line 858 in meshtastic/__main__.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/__main__.py#L858

Added line #L858 was not covered by tests

if args.power_stress:
stress = PowerStress(interface)
Expand Down Expand Up @@ -1584,8 +1584,11 @@ def initParser():
)

power_group.add_argument(
"--slog-out",
help="A directory to store structured logging to, or 'default' for automatically selected.",
"--slog",
help="Store structured-logs (slogs) for this run, optionally you can specifiy a destination directory",
nargs="?",
default=None,
const="default"
)

group.add_argument(
Expand Down

0 comments on commit 5695ec7

Please sign in to comment.