Skip to main content

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:

  1. Clone the repository:
git clone https://github.com/loggingpython-Community/loggingpython.git
  1. Change into the cloned directory:
cd loggingpython
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loggingpython-1.3.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

loggingpython-1.3.2-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file loggingpython-1.3.2.tar.gz.

File metadata

  • Download URL: loggingpython-1.3.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for loggingpython-1.3.2.tar.gz
Algorithm Hash digest
SHA256 37ec5c47beea832f7bedd0b34eebe6a6e5654d1db740076d8991854d6238edc2
MD5 74aec54501443f94e179c9a664143b4a
BLAKE2b-256 8a69680ba97433eb1339ed0acb8c95519844cfe337d945ef54bca97a19be5102

See more details on using hashes here.

File details

Details for the file loggingpython-1.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for loggingpython-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf9a03b17c0795f5f5b9d26356db4fc603bc0dffae38d6198992c05a15ad18b0
MD5 7ad05adffbeaee243bb81e2bfbddabee
BLAKE2b-256 d51f2c54550a12abb11b213fae70387cd5e815f5ca88832b71b9b26d2914d4e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page