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.4.0
This is not the whole new version, Docs still feel
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.
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.4.0.tar.gz
.
File metadata
- Download URL: loggingpython-1.4.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7695be04cc73063d5247ab77469baed46b21cd05827ed180425ec21aabe2c52 |
|
MD5 | f638c6cbc1275c19a863088e835cafc5 |
|
BLAKE2b-256 | ecaf249e6a4b00b61401b4055007d7247118c5471d091e9920187f63e8a55bb9 |
File details
Details for the file loggingpython-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: loggingpython-1.4.0-py3-none-any.whl
- Upload date:
- Size: 31.2 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 | c8fabe9a3b7689fda63107ef4ee2439d1d86e0d542bbe666da284ffbdea73776 |
|
MD5 | 7306c2a39ddda05d8d3916552a732247 |
|
BLAKE2b-256 | a991638cc6e18687ce0959f63fb7f527578eb9200f7a3bb0eca2030523f7ad02 |