Metadata-Version: 2.3
Name: lignum
Version: 0.0.2
Summary: A teensy structured JSON logger for python.
Project-URL: Homepage, https://github.com/rsigrest/lignum
Project-URL: Repository, https://github.com/rsigrest/lignum.git
Author-email: Rob Sigrest <rob.sigrest@gmail.com>
Provides-Extra: test
Requires-Dist: flake8==7.1.1; extra == 'test'
Requires-Dist: pytest==8.3.2; extra == 'test'
Description-Content-Type: text/markdown

# lignum
A teensy structured JSON logger for python.

## Getting Started
Install lignum:
```bash
pip install lignum
```
Import and log to default stream (`sys.stderr`):
```python
import lignum as log
log.info('test') # {"timestamp":1724129120,"message":"test","level":"info"}
```
Change streams to log to `sys.stdout`:
```python
import lignum as log
import sys
log.info('test',stream=sys.stdout)
```
Change streams to log to a file:
```python
import lignum as log
with open('log.log','w',encoding='utf-8') as f:
  log.info('test',stream=f) 
```
Log some extra key-value pairs:
```python
import lignum as log
log.info('test',{'foo':'bar'}) # {"timestamp":1724129120,"message":"test","level":"info","foo":"bar"}
```
