Skip to content
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

--from and --to arguments not working #31

Open
tomcreutz opened this issue Mar 14, 2023 · 3 comments
Open

--from and --to arguments not working #31

tomcreutz opened this issue Mar 14, 2023 · 3 comments

Comments

@tomcreutz
Copy link

tomcreutz commented Mar 14, 2023

Hey,
I'm trying to extract (basically cut) a log file using following command:
pocolog sensor_kvh_1750_Logger.0.log --from 16:38:40.0 --to 17:08:45 --extract sensor_kvh_1750_cut.log --stream sensor_kvh_1750.calibrated_sensors

Unfortunately, I'm getting the following error:
It appears that the from and to functions are not implemented?

	7: from /opt/workspace/tools/pocolog/bin/pocolog:704:in `<main>'
	6: from /usr/lib/ruby/2.5.0/optparse.rb:1523:in `order'
	5: from /usr/lib/ruby/2.5.0/optparse.rb:1532:in `order!'
	4: from /usr/lib/ruby/2.5.0/optparse.rb:1538:in `parse_in_order'
	3: from /usr/lib/ruby/2.5.0/optparse.rb:1538:in `catch'
	2: from /usr/lib/ruby/2.5.0/optparse.rb:1552:in `block in parse_in_order'
	1: from /opt/workspace/tools/pocolog/bin/pocolog:635:in `block (2 levels) in <main>'
/opt/workspace/tools/pocolog/bin/pocolog:566:in `method_missing': undefined method `from' for #<Pocolog::Config:0x000055f016376cc8> (NoMethodError)
@doudou
Copy link
Member

doudou commented Mar 14, 2023

Yeah ... the pocolog CLI is very fragile.

You need to put the --stream first

@tomcreutz
Copy link
Author

tomcreutz commented Mar 22, 2023

Hey,
I tried this command:
pocolog sensor_kvh_1750_Logger.0.log --stream sensor_kvh_1750.calibrated_sensors --from 16:38:40.0 --to 17:08:45 --extract sensor_kvh_1750_cut.log

which, unfortunately again, results in an error:

Traceback (most recent call last):
	9: from /opt/workspace/tools/pocolog/bin/pocolog:704:in `<main>'
	8: from /usr/lib/ruby/2.5.0/optparse.rb:1523:in `order'
	7: from /usr/lib/ruby/2.5.0/optparse.rb:1532:in `order!'
	6: from /usr/lib/ruby/2.5.0/optparse.rb:1538:in `parse_in_order'
	5: from /usr/lib/ruby/2.5.0/optparse.rb:1538:in `catch'
	4: from /usr/lib/ruby/2.5.0/optparse.rb:1552:in `block in parse_in_order'
	3: from /opt/workspace/tools/pocolog/bin/pocolog:672:in `block (2 levels) in <main>'
	2: from /opt/workspace/tools/pocolog/bin/pocolog:672:in `each'
	1: from /opt/workspace/tools/pocolog/bin/pocolog:676:in `block (3 levels) in <main>'
/opt/workspace/tools/pocolog/bin/pocolog:566:in `method_missing': undefined method `streams' for #<Pocolog::Config:0x000055f3350da380> (NoMethodError) 

Could you provide an example command?

@doudou
Copy link
Member

doudou commented Mar 28, 2023

Right. Sorry about that. The usage message is rather unclear.

pocolog --help

File convertion:
        --compress [OUTPUT]          compresses the log files into OUTPUT
        --to-new-format OUTPUT       converts the source file into the new format in OUTPUT
        --extract [OUTPUT]           creates a new log file with only the streams specified
                                     by the following --stream options
        --streams NAME[:start_index[:end_index]]
                                     specifies the stream names for --extract

--extract has to be first (before --stream) and --from and --to are not supported. You may provide sample indexes to --stream as specified in the usage message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants