Loggingpython is a Python package that provides a simple and extensible way to integrate logging into your applications. The package starts with a simple logger and can be extended with additional functions to meet the requirements of your application.
Project description
loggingpython
Version 1.3.0
loggingpython
is a Python package which provides a simple and extensible way to integrate logging into your applications. The package starts with a basic logger and can be extended with additional functions to meet the requirements of your application.
Please always use the most current version
Installation
With pip
For a simple installation via pip, run the following command:
pip install loggingpython
With GitHub
To install the latest development of loggingpython
directly from the GitHub repository, follow these steps:
- Clone the repository:
git clone https://github.com/loggingpython-Community/loggingpython.git
- Change into the cloned directory:
cd loggingpython
- Install the package:
pip install .
Simple Example
In this section, we show how to configure and use a basic logger with loggingpython
. First, we import the package and create a logger:
import loggingpython as lp
# Create a basic logger
logger = lp.getBasicLogger()
This creates a logger with a Filehandler and a Consolehandler, the Consolehandler has colors in the message.
Now, we can use the logger to generate various types of log messages:
# Logging messages at different levels
logger.debug("This is a debug message.")
logger.info("This is an info message.")
logger.warning("This is a warning.")
logger.error("This is an error.")
logger.critical("This is a critical error.")
# Log message with an exception
try:
1 / 0
except ZeroDivisionError as e:
logger.error(f"An exception occurred: {e}")
The file handler saves the logs in the logs/file.log
directory.
This example shows how to configure and use a basic logger to generate various types of log messages.
We welcome your contributions to the development of loggingpython. If you have feedback, suggestions or would like to contribute to the development, please visit our GitHub repository for more information. You can also find more details in our wiki or in the folder Docs
. For more detailed information, please also visit our package page on PyPi.
License
loggingpython
is licensed under the MIT License.
Further resources
Social media
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
File details
Details for the file loggingpython-1.3.1.tar.gz
.
File metadata
- Download URL: loggingpython-1.3.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10e696dca62a4c4ddd8390e7e0a46234aaead81e9c4898654052f6076bd41451 |
|
MD5 | f47eaadc4a2994d90ea4da1da1d88ea1 |
|
BLAKE2b-256 | 517a3c742d7c2e83d23898d30db30f9b267f22e9387d453b2af5ccddcbe22362 |
File details
Details for the file loggingpython-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: loggingpython-1.3.1-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06386daaba0962e3c0d0e6166cedc87a1bb7e7b00ef49bbe5b1ccf7be419a30b |
|
MD5 | ed480410fbd8f676fe5305d3c1580788 |
|
BLAKE2b-256 | 57f894caf7aa07c0f68083141ba96034ed81e92b41607f6e3b95dd5bc7245817 |