Skip to content

Commit

Permalink
Readme: Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdood committed Jun 22, 2022
1 parent d49d9d3 commit 694c819
Showing 1 changed file with 33 additions and 44 deletions.
77 changes: 33 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,39 @@ A simple logging utility.
[![Pytest](https://github.com/mattdood/loggy/actions/workflows/ci.yml/badge.svg)](https://github.com/mattdood/loggy/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/loggy.svg)](https://badge.fury.io/py/loggy)

## Installation
To install the package locally use the following:

```
pip install get-loggy
```

## Features
* Color support
* Custom color support (advanced)
* Add additional logging levels
* Optional log stream vs. log file
* Log record format
* Package level logging

## Usage
Loggy exists as a simple interface for some standard logging in Python.
This is done at the package level, not by name.

```
from loggy import loggy
log = loggy.get_loggy()
log.info("Something")
>>> 2022-06-21 20:16:39 PM PDT | INFO | something | (<stdin>:1:<module>) |
```

## Advanced usage
Custom colors can be created or added along with custom logging levels.
See the [`conftest.py`](./conftest.py) for an example.

## Initial setup
The following GitHub secrets will need to be added in order to release the PyPI
packages without the CI failing:
Expand All @@ -40,47 +73,3 @@ pip install -r requirements-dev.txt
pytest
```

## Linting code
The project utilizes [Pre-Commit](https://pre-commit.com) to execute linting. This
ensures code quality is solid, and is used both in the CI and the `requirements-dev.txt`
for local execution.

The following hooks are used inside Pre-Commit:
* trailing-whitespace
* check-yaml
* isort
* flake8

To run Pre-Commit, use the following:

```bash
pre-commit run --all-files
```

## Releasing builds
To release builds for the project we use a combination of tagging and changes to
`setup.py`.

For any releases to [test.pypi.org](https://test.pypi.org) use a change to the
`version="..."` inside of `setup.py`. Once a PR is merged into the main project
the test release will be updated.

Any prod releases to [pypi.org](https://pypi.org) require a tagged version number.
This should be done locally by running the following:

```bash
git checkout master
git pull master
git tag v<version-number-here>
git push origin v<version-number-here>
```

### Rollbacks of versions
To roll a version back we need to delete the tagged release from the prod PyPI,
then delete the GitHub tag.

```
git tag -d v<version-number-here>
git push origin :v<version-number-here>
```

0 comments on commit 694c819

Please sign in to comment.