Debug and Release the code with same code
Do not use print for debugging and delete print for release
Example Usage
from printDebugging import *
setLevel(DEBUG) # or setLevel("DEBUG")
debug("hi") # printed out
setLevel(QUIET) # set debug level into QUIET
debug("hi") # not printed out
# Configure Color
set_color("purple", INFO) # set foreground color as purple for info
set_color("WHITE", WARN, "bg") # set backgournd color as white for warn
add_style("underline", DEBUG)
reset_style(WARN)
reset_style()
# Configure Prefix
setLevel(INFO)
set_prefixes("{trace}", INFO) # Add string as prefix for INFO
info("HI") # FileName with Line number is printed out as prefix
import datetime
set_prefixes(datetime.datetime.now) # Add function with no parameter as prefix
info("hello") # Result of `datetime.datetime.now()` is printed out as prefix
# Configure postfix
import traceback
set_postfixes(traceback.format_exc, ERROR)
try:
0 / 0
except:
error("Expected Error") # traceback is printed out
Debug Level
QUIET : DO NOT PRINT EXCEPT “error”
INFO : Print info and error
VERBOSE : Print info, warn and error
DEBUG : print info, warn, error and debug
TO DO
Add function with arugment as prefix or postfix
Metadata
Release files for print-debugging 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| print_debugging-0.0.2.tar.gz | 4.3 kB | Without provenance | Details for print_debugging-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| print_debugging-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for print_debugging-0.0.2-py3-none-any.whl |
Total release size: 9.4 kB
Release files / print_debugging-0.0.2.tar.gz
| Download URL | print_debugging-0.0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
298fe926eee05166ba8c1c5f5c23d2a316730c3621c25e47cf1500238991ddc5
|
|
BLAKE2b-256 checksum How to use checksums |
d0de11ef51371c6dd8d51f4e5782491a16521e3bdf098933f7c1b6f4c3c2bdb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
|
Release files / print_debugging-0.0.2-py3-none-any.whl
| Download URL | print_debugging-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e587f4efb2c782ab6a016a3844e60a6ada3bed19f1058dfc67605a12698fa16
|
|
BLAKE2b-256 checksum How to use checksums |
098139406f05029d500bd5eec062bceafdca55c1a1725d202f3c421025bc3d32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
|
Security for print-debugging 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.