Skip to content

Commit

Permalink
Add option --duration also to base logger
Browse files Browse the repository at this point in the history
  • Loading branch information
m3d committed May 21, 2024
1 parent 7ad5742 commit e44ef5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osgar/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ def main():
parser.add_argument('--format', help='use python format - available fields sec, timestamp, stream_id, data')
parser.add_argument('--all', help='dump all messages', action='store_true')
parser.add_argument('--raw', help='dump raw data', action='store_true')
parser.add_argument('--duration', help="limit extraction to given time", type=float)
args = parser.parse_args()

if args.list_names:
Expand Down Expand Up @@ -423,7 +424,7 @@ def main():
for name in args.stream:
only_stream.append(lookup_stream_id(args.logfile, name))

with LogReader(args.logfile, only_stream_id=only_stream) as log:
with LogReader(args.logfile, only_stream_id=only_stream, duration=args.duration) as log:
for timestamp, stream_id, data in log:
if stream_id != 0:
data = deserialize(data)
Expand Down

0 comments on commit e44ef5e

Please sign in to comment.