Skip to content

A Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.

Notifications You must be signed in to change notification settings

PB2204/Py-Error-Handling-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

Error Handling and Logging Toolkit for Python

A Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.

Features

  • Custom error handling with CustomError class.
  • Flexible error logging with customizable log formats.
  • Example usage and unit tests included.

Installation

You can install the toolkit using pip:

pip install py-error-handling-toolkit

Usage

Here's how you can use the toolkit in your Python code:

from toolkit.error_handler import CustomError, handle_error
from toolkit.logger import setup_logger

# Initialize the logger
logger = setup_logger('error.log')

try:
    # Code that may raise exceptions
    raise CustomError("This is a custom error.")
except CustomError as ce:
    handle_error(ce, log_function=logger.error)
except Exception as e:
    handle_error(e, log_function=logger.error)
else:
    logger.info("No errors occurred.")

For more detailed usage instructions, see the full documentation.

Contributing

Contributions are welcome! Please check out the contribution guidelines for details on how to contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages