Metadata-Version: 2.1
Name: serpentscribe
Version: 0.2
Summary: A fast and simple logging decorator for Python functions.
Home-page: https://github.com/dad2jrn/serpentscribe
Author: Ron Meck
Author-email: dad2jrn@gmail.com
License: MIT
Description-Content-Type: text/markdown
License-File: LICENSE

# 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:

```bash
pip install serpentscribe
```
## Usage

To use SerpentScribe, import the log_output decorator and apply it to any function.  All inputs and outputs are logged to stdout and if specified, to a JSON file:

```python
from serpentscribe.logger import log_output

# Specify logger level (required) and file path (optional)
@log_output(logger_level="DEBUG", file_path="/path/to/log/file")
def my_function(arg1, arg2):
    # Function logic here
    return "Result"
```

## Logging Level

A logging level is a required argument when setting the decorator. The following are supported:

| LEVEL       | Description     |
| :------------- | -----------: |
| DEBUG   | Detailed information, typically only of interest to a developer trying to diagnose a problem. |
| INFO   | Confirmation that things are working as expected. |
| WARNING   | An indication that something unexpected happened, or that a problem might occur in the near future (e.g. ‘disk space low’). The software is still working as expected. |
| ERROR   | Due to a more serious problem, the software has not been able to perform some function. |
| CRITICAL   | A serious error, indicating that the program itself may be unable to continue running. |


## Logging to a File

SerpentScribe will always output to stdout.  If a file is specified, then logging will be sent to `stdout` as well as the specified file.
The log file will have the logs written in JSON format, which is both human-readable and easy to process programmatically. If a path for the log file is not specified, the logs will instead be written to `stdout`.

## Running Tests

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

```bash
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](/CONTRIBUTION.md) to get started.

## License

SerpentScribe is licensed under the MIT License. See the [LICENSE](/LICENSE) file for more details.

## Contact

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