# FriendlyLog: Python logging made simple
![FriendlyLog logo](https://github.com/SebiSebi/friendlylog/blob/master/icons/facebook_cover_photo_2.png)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/SebiSebi/friendlylog/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/SebiSebi/friendlylog.svg?branch=master)](https://travis-ci.com/SebiSebi/friendlylog)
[![codecov](https://codecov.io/gh/SebiSebi/friendlylog/branch/master/graph/badge.svg)](https://codecov.io/gh/SebiSebi/friendlylog)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/803817c9fe964b8b8b591112ab41e913)](https://www.codacy.com/manual/SebiSebi/friendlylog?utm_source=github.com&utm_medium=referral&utm_content=SebiSebi/friendlylog&utm_campaign=Badge_Grade)
[![Python Versions](https://img.shields.io/badge/python-2.7%20%7C%203.4%20%7C%203.5%20%7C%203.6%20%7C%203.7-blue)](https://pypi.org/project/friendlylog/)
[![Downloads](https://pepy.tech/badge/friendlylog/month)](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.
Raw data
{
"_id": null,
"home_page": "https://github.com/SebiSebi/friendlylog",
"name": "friendlylog",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "sebisebi",
"author_email": "gpirtoaca@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7d/9c/2bb26e81d26da5226a40a7993af30e1ce0fe3ca432c3fa24e352ef3bb4ed/friendlylog-1.0.2.tar.gz",
"platform": "",
"description": "# FriendlyLog: Python logging made simple\n\n![FriendlyLog logo](https://github.com/SebiSebi/friendlylog/blob/master/icons/facebook_cover_photo_2.png)\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/SebiSebi/friendlylog/blob/master/LICENSE)\n[![Build Status](https://travis-ci.com/SebiSebi/friendlylog.svg?branch=master)](https://travis-ci.com/SebiSebi/friendlylog)\n[![codecov](https://codecov.io/gh/SebiSebi/friendlylog/branch/master/graph/badge.svg)](https://codecov.io/gh/SebiSebi/friendlylog)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/803817c9fe964b8b8b591112ab41e913)](https://www.codacy.com/manual/SebiSebi/friendlylog?utm_source=github.com&utm_medium=referral&utm_content=SebiSebi/friendlylog&utm_campaign=Badge_Grade)\n\n[![Python Versions](https://img.shields.io/badge/python-2.7%20%7C%203.4%20%7C%203.5%20%7C%203.6%20%7C%203.7-blue)](https://pypi.org/project/friendlylog/)\n[![Downloads](https://pepy.tech/badge/friendlylog/month)](https://pypistats.org/packages/friendlylog)\n\nFriendlyLog is a simple, colorful, user-friendly, thread-safe logger for `Python` (`2` and `3`).\n\n<img src=\"https://github.com/SebiSebi/friendlylog/blob/master/images/tutorial.gif\">\n\nInstall\n-------\n\n```bash\npip install friendlylog\n```\n\n\nUsage\n-----\n\n1. Simple Logger\n\n```python\nimport logging\n\nfrom friendlylog import simple_logger as log\n\n# Anything above or including DEBUG will be logged.\nlog.setLevel(logging.DEBUG) \n\nlog.debug(\"debug message\")\nlog.info(\"info message\")\nlog.warning(\"warning message\")\nlog.error(\"error message\")\nlog.critical(\"critical message\")\n```\n\nWill result in the following logs (`test.py` is the name of the file):\n```\n[07-Oct-19 11:06:06.107 in test.py - <module>: 3] DEBUG: debug message\n[07-Oct-19 11:06:06.107 in test.py - <module>: 4] INFO: info message\n[07-Oct-19 11:06:06.107 in test.py - <module>: 5] WARNING: warning message\n[07-Oct-19 11:06:06.107 in test.py - <module>: 6] ERROR: error message\n[07-Oct-19 11:06:06.107 in test.py - <module>: 7] CRITICAL: critical message\n```\n\n2. Colored Logger\n\n```python\nimport logging\n\nfrom friendlylog import colored_logger as log\n\n# Anything above or including DEBUG will be logged.\nlog.setLevel(logging.DEBUG) \n\nlog.debug(\"debug message\")\nlog.info(\"info message\")\nlog.warning(\"warning message\")\nlog.error(\"error message\")\nlog.critical(\"critical message\")\n```\n\nWill result in the following logs (`test.py` is the name of the file):\n\n<img src=\"https://github.com/SebiSebi/friendlylog/blob/master/images/colored_log.png\" max-width=\"715\" height=\"86\"/>\n\n\nContributing\n------------\n\n1. Write the code for a new logger under `friendlylog`. It should export the following methods:\n \t* `setLevel(level)`\n\t* `debug(msg: string)`\n \t* `info(msg: string)`\n \t* `warning(msg: string)`\n \t* `error(msg: string)`\n \t* `critical(msg: string)`\n2. Write unit tests with `>92%` coverage under `tests`. You can run the tests locally\nusing this command: `bash run_tests.sh`. Make sure the new logger is thread-safe. Also,\nadd a unit test that checks thread-safety;\n3. Submit a pull-request with your changes.\n\n\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Python logging for humans: colorful, clean interface, straightforward usage, simply friendly log.",
"version": "1.0.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "e68368a7ba0965f126dff50b182a1fde",
"sha256": "ef013660d1b0f021681d9745c2e4223ae8956794ed92ef643727405bd4e11ba8"
},
"downloads": -1,
"filename": "friendlylog-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e68368a7ba0965f126dff50b182a1fde",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9417,
"upload_time": "2019-10-28T13:09:05",
"upload_time_iso_8601": "2019-10-28T13:09:05.170129Z",
"url": "https://files.pythonhosted.org/packages/ce/c4/672baae9d30bd8330448ed823ce747ab739dcbf7844ecccb3ca05fb0f1be/friendlylog-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "154aba48ac1db67a0e7db0d40c534171",
"sha256": "0dac3b29eb8c239c3023ceaf40656d20189d656149956e4b03630203a7b691a0"
},
"downloads": -1,
"filename": "friendlylog-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "154aba48ac1db67a0e7db0d40c534171",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3886,
"upload_time": "2019-10-28T13:09:07",
"upload_time_iso_8601": "2019-10-28T13:09:07.057995Z",
"url": "https://files.pythonhosted.org/packages/7d/9c/2bb26e81d26da5226a40a7993af30e1ce0fe3ca432c3fa24e352ef3bb4ed/friendlylog-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-10-28 13:09:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "SebiSebi",
"github_project": "friendlylog",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"requirements": [
{
"name": "colored",
"specs": [
[
">=",
"1.4.0"
]
]
},
{
"name": "six",
"specs": [
[
">=",
"1.12.0"
]
]
},
{
"name": "codecov",
"specs": []
},
{
"name": "coverage",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "pytest-cov",
"specs": []
}
],
"lcname": "friendlylog"
}