Git Product home page Git Product logo

Comments (7)

bkueng avatar bkueng commented on September 17, 2024

I prefer the exception because it makes it clear the log is corrupt.
If you want to make it an option, that works for me as well.

from pyulog.

devbharat avatar devbharat commented on September 17, 2024

Thanks, that sounds good. I'll make a PR.

from pyulog.

devbharat avatar devbharat commented on September 17, 2024

Just to be clear, the defaut behaviour when parsing strings in pyulog currently is different for python 2 and python 3. Python2 silently ignores and python3 fails over. I think the default behaviour should report the error and print warning but not failover, keeping pyulog robust to external errors.

from pyulog.

bkueng avatar bkueng commented on September 17, 2024

I think the default behaviour should report the error and print warning but not failover, keeping pyulog robust to external errors.

There's a trade-off: if you have parsing errors, you cannot trust the data. Can you make it a parameter disable_parser_exceptions to ULog(), and if True, set self._file_corrupt instead of raising the exception?

from pyulog.

devbharat avatar devbharat commented on September 17, 2024

There's a trade-off: if you have parsing errors, you cannot trust the data.

While that's true, often log analysis comes down to recovering as much logged info from a logfile as possible - especially for crash logs. Only then you'd consider the matter of 'trustability' of the data. I can't imagine a scenario where a user expects a log parsing pipeline to stop midway and discard rest of the logged data because it encountered unexpected bytes (especially true if the corrupt bytes are not message identifiers, but string payload of message packets!).

Still unclear points to me in discussion are difference in python2 and python3 behavior, and whether ascii should be the default or utf-8.

Can you make it a parameter disable_parser_exceptions to ULog(), and if True, set self._file_corrupt instead of raising the exception?

Sounds like a good idea.

from pyulog.

devbharat avatar devbharat commented on September 17, 2024

Also note #40

from pyulog.

bkueng avatar bkueng commented on September 17, 2024

As I wrote I'm fine with making this configurable (the default can be either way). What's important to me is that we have the reporting of exceptions, both in Flight Review and the scripts.

Still unclear points to me in discussion are difference in python2 and python3 behavior, and whether ascii should be the default or utf-8.

Preferably utf-8.

from pyulog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.