friendlylog-1.0.2
توضیحات
Python logging for humans: colorful, clean interface, straightforward usage, simply friendly log.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | friendlylog-1.0.2 |
| نام | friendlylog |
| نسخه کتابخانه | 1.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | sebisebi |
| ایمیل نویسنده | gpirtoaca@gmail.com |
| آدرس صفحه اصلی | https://github.com/SebiSebi/friendlylog |
| آدرس اینترنتی | https://pypi.org/project/friendlylog/ |
| مجوز | Apache 2.0 |
# FriendlyLog: Python logging made simple

[](https://github.com/SebiSebi/friendlylog/blob/master/LICENSE)
[](https://travis-ci.com/SebiSebi/friendlylog)
[](https://codecov.io/gh/SebiSebi/friendlylog)
[](https://www.codacy.com/manual/SebiSebi/friendlylog?utm_source=github.com&utm_medium=referral&utm_content=SebiSebi/friendlylog&utm_campaign=Badge_Grade)
[](https://pypi.org/project/friendlylog/)
[](https://pypistats.org/packages/friendlylog)
FriendlyLog is a simple, colorful, user-friendly, thread-safe logger for `Python` (`2` and `3`).
<img src="https://github.com/SebiSebi/friendlylog/blob/master/images/tutorial.gif">
Install
-------
```bash
pip install friendlylog
```
Usage
-----
1. Simple Logger
```python
import logging
from friendlylog import simple_logger as log
# Anything above or including DEBUG will be logged.
log.setLevel(logging.DEBUG)
log.debug("debug message")
log.info("info message")
log.warning("warning message")
log.error("error message")
log.critical("critical message")
```
Will result in the following logs (`test.py` is the name of the file):
```
[07-Oct-19 11:06:06.107 in test.py - <module>: 3] DEBUG: debug message
[07-Oct-19 11:06:06.107 in test.py - <module>: 4] INFO: info message
[07-Oct-19 11:06:06.107 in test.py - <module>: 5] WARNING: warning message
[07-Oct-19 11:06:06.107 in test.py - <module>: 6] ERROR: error message
[07-Oct-19 11:06:06.107 in test.py - <module>: 7] CRITICAL: critical message
```
2. Colored Logger
```python
import logging
from friendlylog import colored_logger as log
# Anything above or including DEBUG will be logged.
log.setLevel(logging.DEBUG)
log.debug("debug message")
log.info("info message")
log.warning("warning message")
log.error("error message")
log.critical("critical message")
```
Will result in the following logs (`test.py` is the name of the file):
<img src="https://github.com/SebiSebi/friendlylog/blob/master/images/colored_log.png" max-width="715" height="86"/>
Contributing
------------
1. Write the code for a new logger under `friendlylog`. It should export the following methods:
* `setLevel(level)`
* `debug(msg: string)`
* `info(msg: string)`
* `warning(msg: string)`
* `error(msg: string)`
* `critical(msg: string)`
2. Write unit tests with `>92%` coverage under `tests`. You can run the tests locally
using this command: `bash run_tests.sh`. Make sure the new logger is thread-safe. Also,
add a unit test that checks thread-safety;
3. Submit a pull-request with your changes.
نیازمندی
| مقدار | نام |
|---|---|
| >=1.4.0 | colored |
| >=1.12.0 | six |
نحوه نصب
نصب پکیج whl friendlylog-1.0.2:
pip install friendlylog-1.0.2.whl
نصب پکیج tar.gz friendlylog-1.0.2:
pip install friendlylog-1.0.2.tar.gz