Functions to neatly print debug information to the terminal output, well-suited for multithreaded programs.
Project description
DvG_debug_functions
Provides functions for printing debug information to the terminal output.
dprint()
dprint(str_msg, ANSI_color=None)
'Debug' print a single line to the terminal with optional ANSI color codes. The line will be terminated with a newline character and the terminal output buffer is forced to flush before and after every print. In addition, if PyQt5 is present in the Python environment, then a mutex lock will be obtained and released again for each dprint execution.
There is a lot of overhead using this print statement, but it is particularly well-suited for multithreaded PyQt programs where multiple threads are each printing information to the same terminal. The dprint
function ensure that each line sent to the terminal will remain as a continious single line, whereas a regular print
statement will likely result in the lines getting mixed up.
print_fancy_traceback()
print_fancy_traceback(err, back=3)
Prints the exception err
to the terminal with a traceback that is back
deep, using ANSI color codes that mimic the IPython command shell.
Example output:
Changelog
0.0.1 (2020-05-13)
- First release on PyPI.
1.0.0 (2020-05-14)
- Updated comments.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dvg-debug-functions-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad22400657be0e8baa19f8736c93de3d888c423ee9f5b327e00a9fc81a6ba0a8 |
|
MD5 | 375bcbbb3525178b92a3278fc8b81efa |
|
BLAKE2b-256 | 9f320909a5bfefff49cadade07fd85ae6f8edafa2abbafd74dfb84637e508b28 |
Hashes for dvg_debug_functions-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4390fd905559027847d5e266a80a94f5906db53c31732c6f3e9bb3d6b39eff4c |
|
MD5 | 3414d953aada3de3006448dbe751c5e9 |
|
BLAKE2b-256 | 9a135bfff45361d818b228b8e7797a92f59a2c60bc58bc26960455097ddc05a0 |