Skip to main content

A fast and simple logging decorator for Python functions

Project description

SerpentScribe

serpentscribe is a simple, yet powerful Python logging library designed to make function call logging effortless. It provides a decorator to automatically log the details of function calls, including arguments and return values, to a JSON file.

Features

  • Easy to use: Simply decorate your functions to start logging.
  • Logs function name, arguments, return values, and timestamp.
  • Customizable log file path.

Installation

Install SerpentScribe using pip:

pip install serpentscribe

Usage

To use SerpentScribe, import the log_output decorator and apply it to any function:

from serpentscribe.logger import log_output

@log_output
def my_function(arg1, arg2):
    # Function logic here
    return "Result"

By default, logs are written to function_log.json in the current directory. You can change the log file path by modifying the Logger class instantiation inside the decorator.

Running Tests

To run tests, navigate to the root directory of the project and execute:

python -m unittest discover -s tests

Ensure you have a test suite available in the tests directory.

Contribution

Contributions to SerpentScribe are welcome! Please read the contributing guidelines CONTRIBUTION to get started.

License

SerpentScribe is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any queries or suggestions, feel free to contact the maintainer using Github

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

serpentscribe-0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file serpentscribe-0.1-py3-none-any.whl.

File metadata

  • Download URL: serpentscribe-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for serpentscribe-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e6c0fec345a3ea5fb8dc88932b276b2f8a3f139afc9fa01e5e33bd30cb671a6
MD5 7392212feb545610d03997f67131b1a1
BLAKE2b-256 7a904bd476e92c6743de535d21311cd8007318c6384be69f073d38c607db130e

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