Skip to content

Commit

Permalink
0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
papito committed Jul 10, 2021
1 parent 56e48f3 commit 5b9f342
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 333 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.9.3
=====
* Adding ColorPlainTextStreamHandler for easy-to-read colorized logs
* ColorJsonStreamHandler is the new ColorStreamHandler
* Fixing the caller location code (broken in Python 3.x migration)

v0.9.2
=====
* Log level JSON key was not being emphasized when color handler was on (broken in Python 3.x migration)
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ install:
poetry install

build:
poetry run mdToRst README.md > README.rst
poetry build

lint:
Expand All @@ -16,5 +15,8 @@ lint:
test:
@poetry run nosetests

visual:
@poetry run nosetests -s

info:
@poetry env info
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Sift Log - JSON logging adapter for Python (now in color)
===============

![](https://raw.githubusercontent.com/papito/siftlog-py/master/assets/screen.png)

## Features
* Tag log statements with arbitrary values for easier grouping and analysis
* Add keyword arguments that are converted to JSON values
Expand Down Expand Up @@ -50,7 +52,7 @@ logger.addHandler(handler)

log = SiftLog(logger)
```
In this fashion, you can direct the JSON logs to [any logging handler](https://docs.python.org/2/library/logging.handlers.html)
In this fashion, you can direct the JSON logs to [any logging handler](https://docs.python.org/2/library/logging.handlers.html).

#### Color
For enhanced flamboyancy, attach the `ColorStreamHandler` to your logger. The output will not have color if the logs
Expand All @@ -66,11 +68,12 @@ logger.addHandler(handler)
log = SiftLog(logger)
```

For development, you can opt in to use `ColorPlainTextStreamHandler`, for logs that are easier to parse visually.

##### Performance

While the above should play, it's highly recommended that the color handler is only
attached conditionally for local development. Too many log statements could otherwise become
expensive in terms of CPU.
attached conditionally for local development.


##### Different colors
Expand Down Expand Up @@ -148,6 +151,7 @@ SiftLog.log.MESSAGE = "MESSAGE"
`Poetry` is used to manage the dependencies.

Most things can be accessed via the Makefile, if you have Make installed.
Without Make, just inspect the Makefile for the available commands.

# use the right Python
poetry use path/to/python/3.8-ish
Expand All @@ -157,5 +161,7 @@ Most things can be accessed via the Makefile, if you have Make installed.
make install
# run tests
make test
# run visual tests (same as tests but with output)
make visual
# formatting, linting, and type checking
make lint
269 changes: 0 additions & 269 deletions README.rst

This file was deleted.

Binary file added assets/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "siftlog-py"
version = "0.9.2"
version = "0.9.3"
description = "Structured JSON logging"

license = "MIT"
Expand All @@ -11,7 +11,7 @@ authors = ["Andrei Taranchenko <drey10@gmail.com>"]
keywords = ["logging", "logs"]

include = [
"LICENSE", "README.rst"
"LICENSE", "README.md"
]

packages = [
Expand Down
Loading

0 comments on commit 5b9f342

Please sign in to comment.