A Python package to log messages using a print-like function.
Project description
printx
printx is a Python package that provides a print-like function for logging messages.
Installation
You can install printx via pip:
pip install printx
Usage
from printx import printx_configure, printx
# Configure logging (optional: specify a custom log filename)
printx_configure()
# Use the printx function
printx("This is a default info message")
printx("This is a debug message", log_level='debug')
printx("This is an info message", log_level='info')
printx("This is a warning message", log_level='warning')
printx("This is an error message", log_level='error')
printx("This is a critical message", log_level='critical')
def example_function():
try:
printx("Starting the function")
printx("Performing an action")
error_condition = True # Simulate an error condition
if error_condition:
raise ValueError("An error occurred")
printx("Function finished")
except Exception as e:
printx(f"Exception occurred: {e}", log_level='error')
example_function()
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
Author
Acknowledgments
- Thanks to the open-source community for providing the tools and inspiration for this project.
- Special thanks to all contributors and users of the package.
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
printx-1.0.0.tar.gz
(2.3 kB
view details)
Built Distribution
File details
Details for the file printx-1.0.0.tar.gz
.
File metadata
- Download URL: printx-1.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53bb584726ac1a42945c96491525f77efce0eb2e7e462b1892ed108c0c431baf |
|
MD5 | ecc87168b070954ff927a84fc56475b6 |
|
BLAKE2b-256 | ada96883728a07f4a44afdc0e846d2982867b2a9f7c114f9cadff5581bb829a7 |
File details
Details for the file printx-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: printx-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce2b7df9f7c7a12f809663d908f3538fdf2cfb6f2b46355ea97cf7ca51b3448 |
|
MD5 | 104372a45f2cbecbae86ca4089d63ff9 |
|
BLAKE2b-256 | 07f7d1caafd070c18d89386e41336303d336c7dfb4732fb745b1c8765269b6fb |