Skip to main content

Trace toolkit to print formatted traces of binary data

Project description

A simple library to print formatted trace messages (especially useful with the binary data):

>>> trace(binary_data)
12:08:16.762628 >> 206 bytes sent:
       00 cc 30 31 30 30 72 30 05 80 20 c0 92 00 31 36         ..0100r0.. ...16
       38 39 39 30 30 31 31 32 33 34 35 36 37 38 39 30         8990011234567890
       30 30 30 30 30 30 30 30 30 30 30 30 30 32 30 30         0000000000000200
       30 30 31 34 39 34 35 30 34 34 39 34 38 30 30 32         0014945044948002
       33 31 31 37 30 35 31 31 31 32 30 38 31 34 39 30         3117051112081490
       30 31 30 30 30 30 33 32 38 39 39 30 30 31 31 32         0100003289900112
       33 34 35 36 37 38 39 30 44 31 38 30 39 32 30 31         34567890D1809201
       31 38 37 32 33 30 30 30 31 30 30 30 31 33 33 37         1872300010001337
       39 39 39 39 39 39 39 39 39 39 39 39 30 30 31 36         9999999999990016
       34 33 2b 68 7a ef c3 4b 1a 89 30 34 39 82 02 00         43+hz..K..049...
       00 9a 03 17 05 11 95 05 00 00 04 08 80 9f 10 02         ................
       00 00 9f 26 08 ed 2c d0 d2 98 94 fb aa 9f 36 02         ...&..,.......6.
       00 01 9f 37 04 8f a4 f2 bd 9f 1a 02 06 43               ...7.........C
>>> trace(binary_data)
12:08:17.013138 << 110 bytes received:
       00 6c 30 31 31 30 72 30 00 00 0e 80 80 00 31 36         .l0110r0......16
       38 39 39 30 30 31 31 32 33 34 35 36 37 38 39 30         8990011234567890
       30 30 30 30 30 30 30 30 30 30 30 30 30 32 30 30         0000000000000200
       30 30 31 34 39 34 35 30 34 34 39 34 38 30 30 32         0014945044948002
       33 31 31 37 30 35 31 31 31 32 30 38 31 34 30 30         3117051112081400
       30 30 30 30 31 30 36 38 34 38 31 30 36 38 34 38         0000106848106848
       30 30 30 31 30 30 30 31 33 33 37 36 34 33               00010001337643

Usage:

>>> from tracetools.tracetools import trace
>>> trace(b'\x01\xFF17398172371892371982737981723')
22:27:00.967302
       01 ff 31 37 33 39 38 31 37 32 33 37 31 38 39 32         ..17398172371892
       33 37 31 39 38 32 37 33 37 39 38 31 37 32 33            371982737981723
>>> trace(title='Some stuff received:', data=b'\x00\x6c\x30\x31\x31\x30\x72\x30\x00\x00\x0e\x80\x80\x00\x31\x36')
22:28:53.709328 Some stuff received:
       00 6c 30 31 31 30 72 30 00 00 0e 80 80 00 31 36         .l0110r0......16

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracetools-1.26.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file tracetools-1.26.tar.gz.

File metadata

  • Download URL: tracetools-1.26.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tracetools-1.26.tar.gz
Algorithm Hash digest
SHA256 1ff2bed247265512acd46b13300a71cfeb8be53111b308ef6682ffbf565fb39d
MD5 14155963f7717329d657fd127110c4f9
BLAKE2b-256 38c1d6f49a7cd2fb9bb2f4a605ccdafbfa5815a8286b21f6575722c57962ac38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page