Git Product home page Git Product logo

dltpy's Introduction

dltpy - library and utilities for DLT logging

Installing

Requirements (not handled by pip/setuptools)
Installation

Once the requirements mentioned above are ready, you can install dltpy with pip just as any other python package:

  • current master from git:
pip install --user git+https://github.com/Equidamoid/dltpy.git
  • last version from pypi:
pip install --user dltpy
  • an editable "developer" mode:
git clone https://github.com/Equidamoid/dltpy.git
pip install --user -e dltpy

Using

There are 3 commandline utilities that demonstrate usage of the library:

  • dltpy-print prints specified .dlt file as plain text. "text-like" payloads are decoded and printed as text, others are repr()ed
  • dltpy-filter filters out unneeded boring messages. Run it with -f IDS:OF YOUR:APPS and enjoy tiny logs that take seconds to load.
  • dltpy-receive demonstrates integration with asyncio and direct use of the native module, like dlt-receive. The main difference is that it gracefully reconnects if, for example, your device reboots.

Please note that non-verbose messages are skipped by DltFile since it has no way of decoding the payload.

dltpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dltpy's Issues

Memory exception on armhf platform raspberry pi

Hi, I'd like to report a bug.

After compiling fmtlib and installing dltpy on a raspberry pi 3B , the module seems to be broken.

The same steps on a x86_64 platform worked without any problem.

$ dltpy-print example.dlt 
[2020-09-29 19:34:12,059] - Will print file example.dlt with filters: []
filter len: 0
fwd filter len: 0
Traceback (most recent call last):
  File "/usr/local/bin/dltpy-print", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/dltpy/dltpy_print.py", line 47, in main
    for dm in dltf:
  File "/usr/local/lib/python3.7/dist-packages/dltpy/transforms/__init__.py", line 10, in apply_transforms
    for msg in it:
  File "/usr/local/lib/python3.7/dist-packages/dltpy/dltfile.py", line 171, in __iter__
    ret = self.get_next_message()
  File "/usr/local/lib/python3.7/dist-packages/dltpy/dltfile.py", line 165, in get_next_message
    m = DltMessage(self.rdr)
  File "/usr/local/lib/python3.7/dist-packages/dltpy/dltfile.py", line 70, in __init__
    self._load(reader)
  File "/usr/local/lib/python3.7/dist-packages/dltpy/dltfile.py", line 90, in _load
    self._raw_payload = bytes(reader.get_payload())
SystemError: Negative size passed to PyBytes_FromStringAndSize

dlt-convert does work on the raspberry pi 3B.

$ dlt-convert -a example.dlt 
0 2020/09/12 19:05:40.644940    6244253 000 ECU1 DA1- DC1- control response N 1 [service(3842), ok, 02 00 00 00 00]
1 2020/09/12 19:05:40.645094    5701774 000 ECU1 DA1- DC1- control response N 1 [service(3842), ok, 01 00 00 00 00]
2 2020/09/12 19:05:40.645119    5701775 118 ECU1 DLTD INTM log info V 1 [Client connection #7 closed. Total Clients : 0]
3 2020/09/12 19:05:40.645151    5701906 119 ECU1 DLTD INTM log info V 1 [ApplicationID 'SINA' registered for PID 6063, Description=stdin adaptor application]
4 2020/09/12 19:05:40.645237    5701906 000 ECU1 DA1- DC1- control response N 1 [get_log_info, 07, 01 00 53 49 4e 41 01 00 53 49 4e 43 ff ff 15 00 73 74 64 69 6e 20 61 64 61 70 74 6f 72 20 63 6f 6e 74 65 78 74 19 00 73 74 64 69 6e 20 61 64 61 70 74 6f 72 20 61 70 70 6c 69 63 61 74 69 6f 6e 72 65 6d 6f]
5 2020/09/12 19:05:40.645297    5701907 000 ECU1 SINA SINC log info V 1 [Hello, world! ]

Header dependency changes in GCC 10

Hi,
I would like to report that the header dependency changes in GCC 10 have been changed to no longer include the header. As such, C++ programs that used components defined in or without explicitly including the right headers will no longer compile. The link shows the changes.
Thus the dltpy/native/bitmasks.h, dltpy/native/dltreader.h and dltpy/native/parsers.h require '#include '.

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.