Skip to main content

A Easy Logging Tool for Python

Project description

Easy Logging Package

Easy Logging is a Python package that simplifies the process of setting up logging in your Python applications. With Easy Logging, you can easily configure logging to suit your needs, without having to write a lot of boilerplate code.

Installation

You can install Easy Logging using pip:

pip install easy-logging

Usage

Here's an example of how you can use Easy Logging to configure logging in your Python application:

# main.py
from easy_logging import EasyLogging, EasyLoggingSetup

# Configure logging for json mode 
EasyLoggingSetup(enable_json_mode=True)

# Get the logger for the current module
logger = EasyLogging.getLogger(__name__)

# Log messages
logger.debug('This is a debug message')
logger.info('This is an info message')
logger.warning('This is a warning message')
logger.error('This is an error message')
logger.critical('This is a critical message')

In this example, we import the Logging class from the easy_logging package and use it to configure logging. We can pass an optional enable_json_mode argument to the Logging class to enable JSON formatting for the log messages. We then use the getLogger method to get a logger object that we can use to log messages.

Configuration

Easy Logging uses a YAML configuration file to configure logging. By default, the configuration file is located in the same directory as the easy_logging package. You can customize the configuration by creating a log-config.yml file in the same directory as your Python script and modifying the configuration as needed.

Contributing

Contributions to Easy Logging are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository. If you'd like to contribute code, please fork the repository and submit a pull request.

License

Easy Logging is licensed under the MIT License. See the LICENSE file for details.

You can copy and paste this source code into a file named README.md in the root directory of your project. how to add code in readme.md

To add code to a README.md file, you can use Markdown syntax to format the code as a code block. Here's an example of how to add a code block to a README.md file:

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

easy_logging_setup-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_logging_setup-0.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file easy_logging_setup-0.0.2.tar.gz.

File metadata

  • Download URL: easy_logging_setup-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for easy_logging_setup-0.0.2.tar.gz
Algorithm Hash digest
SHA256 23e03a3f9ee7b7ffcae0c443331ede5012cc7c63e9e06ae0dff702c63fbea9c5
MD5 df0f455d0cc22299a3a07a70eccb2c1a
BLAKE2b-256 f521b54e110a80d9ce221bed9a5bd44bc648e94289111a35c76b5dbf79955ced

See more details on using hashes here.

File details

Details for the file easy_logging_setup-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_logging_setup-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc5fa6dd5ff6582920258a3233949ead4b9c5a049c8bbe50c0ff46c414fb368
MD5 ed1939fade40a82c4e02ca5b0038ccb3
BLAKE2b-256 50eec9b80dacb032522161d7ead59fe22fb18babb7b4e333161f21314e77ca9d

See more details on using hashes here.

Supported by

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