Skip to content

Commit

Permalink
info: filter 'perf_*' info messages by default, show them with --verb…
Browse files Browse the repository at this point in the history
…ose flag
  • Loading branch information
bkueng committed Mar 16, 2017
1 parent d508da2 commit 199fe6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyulog/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def main():
"""Commande line interface"""
parser = argparse.ArgumentParser(description='Display information from an ULog file')
parser.add_argument('filename', metavar='file.ulg', help='ULog input file')
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose output', default=False)


args = parser.parse_args()
Expand Down Expand Up @@ -45,7 +47,8 @@ def main():

print("Info Messages:")
for k in sorted(ulog.msg_info_dict):
print(" {0}: {1}".format(k, ulog.msg_info_dict[k]))
if not k.startswith('perf_') or args.verbose:
print(" {0}: {1}".format(k, ulog.msg_info_dict[k]))


print("")
Expand Down

0 comments on commit 199fe6d

Please sign in to comment.