Skip to content

Commit 9c3c9ea

Browse files
committed
Skeleton
1 parent 344297b commit 9c3c9ea

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# python-bufflog
2-
Python logger for Buffer services
1+
# Python Bufflog
2+
3+
Python logger for Buffer services.
4+
5+
## Installation
6+
7+
You can use `pip` to install `bufflog`:
8+
9+
```python
10+
pip install bufflog
11+
```
12+
13+
## Usage
14+
15+
```python
16+
17+
import bufflog
18+
19+
bufflog.debug('Hello debug', {"some":"stuff"});
20+
bufflog.info('Hello info');
21+
bufflog.notice('Hello notice with context', {"foo":"bar"});
22+
bufflog.error('Hello error');
23+
bufflog.critical('Hello critical');
24+
```
25+
26+
## Log verbosity levels
27+
28+
If you wish to see more logs, simply set the `LOG_LEVEL` to the desired level. Here a list with some use case:
29+
30+
| Levels | Use case | Examples |
31+
| :------: | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
32+
| DEBUG | Information used for interactive investigation, with no long-term value. Activate it with `LOG_LEVEL=DEBUG` | Printing function names, steps inside a function. |
33+
| INFO | Interesting events. Track the general flow of the application. Activate it with `LOG_LEVEL=INFO` | User logs in, SQL logs, worker process/delete a message... |
34+
| NOTICE | Uncommon events. **This is the default verbosity level**. | Missing environment variables, page redirection, pod starting/restarting/terminating, retrying to query an API... |
35+
| WARNING | Exceptional occurrences that are not errors. Undesirable things that are not necessarily wrong. | Use of deprecated APIs, poor use of an API, unauthorized access, pod restart because of memory limit ... |
36+
| ERROR | Runtime errors. Highlight when the current flow of execution is stopped due to a failure. | Exceptions messages, incorect credentials or permissions... |
37+
| CRITICAL | Critical conditions. Describe an unrecoverable application, system crash, or a catastrophic failure that requires immediate attention. | Application component unavailable, unexpected exception. entire website down, database unavailable ... |

bufflog/__init__.py

Whitespace-only changes.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="python-bufflog",
8+
version="0.0.1",
9+
author="David Gasquez",
10+
author_email="[email protected]",
11+
description="Python logger for Buffer services",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/bufferapp/python-bufflog",
15+
packages=setuptools.find_packages(),
16+
)

0 commit comments

Comments
 (0)