https://github.com/cuuupid/console-logging
Better, prettier commandline logging for Python--with colors! :ghost:
https://github.com/cuuupid/console-logging
color colors commandline console console-log console-logger logging python
Last synced: 5 days ago
JSON representation
Better, prettier commandline logging for Python--with colors! :ghost:
- Host: GitHub
- URL: https://github.com/cuuupid/console-logging
- Owner: cuuupid
- Created: 2017-09-02T05:27:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-12-11T09:31:33.000Z (over 3 years ago)
- Last Synced: 2024-04-24T16:58:51.328Z (12 months ago)
- Topics: color, colors, commandline, console, console-log, console-logger, logging, python
- Language: Python
- Homepage:
- Size: 123 KB
- Stars: 111
- Watchers: 2
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - cuuupid/console-logging - Better, prettier commandline logging for Python--with colors! :ghost: (Python)
README
# console-logging
[ ](https://app.codeship.com/projects/250054)
[](https://badge.fury.io/py/console-logging)
[](https://www.codacy.com/app/pshah123/console-logging?utm_source=github.com&utm_medium=referral&utm_content=pshah123/console-logging&utm_campaign=Badge_Grade)Better console logging for Python.
Find us on PyPi: https://pypi.python.org/pypi/console-logging

## Getting Started
### Dependencies
* Python 2.6+ or Python 3.5+
* `termcolor`### Installation
```
pip install console-logging
```*If building from source:* `bash pipe` from inside this repo.
### Usage
#### New:
``` python
from console_logging.console import Console
console = Console()console.log("Hello world!")
```#### Old:
``` python
from console_logging import consoleconsole.log("Hello World!")
```### Exhaustive Reference
``` python
console.log("This is a log.")
console.error("This is an error.")
console.info("This is some neutral info.")
console.success("This is a success message.")# If using the new usage:
console.setVerbosity(4) # verbosity from 1 - 5, in order:
'''
[1] Errors
[2] Successes
[3] Logs
[4] Info
[5] Secure
'''
console.mute() # shorthand for setVerbosity(0)```
### Example
For an exhaustive example, see `tests/example.py`.
### Credit
* `termcolor` module for colors