Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drkostas/termcolor-logger
A logger with text formatting using termcolor.
https://github.com/drkostas/termcolor-logger
color-log color-logger color-logging logger logging logging-library
Last synced: about 2 months ago
JSON representation
A logger with text formatting using termcolor.
- Host: GitHub
- URL: https://github.com/drkostas/termcolor-logger
- Owner: drkostas
- License: apache-2.0
- Created: 2021-12-15T02:00:43.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-30T01:42:24.000Z (about 3 years ago)
- Last Synced: 2024-10-30T06:40:07.493Z (3 months ago)
- Topics: color-log, color-logger, color-logging, logger, logging, logging-library
- Language: Python
- Homepage: https://pypi.org/project/termcolor-logger/
- Size: 60.5 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Termcolor Logger
[![Downloads](https://static.pepy.tech/personalized-badge/termcolor-logger?period=total&units=international_system&left_color=grey&right_color=red&left_text=Downloads)](https://pepy.tech/project/termcolor-logger)
[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/drkostas/termcolor-logger/blob/master/LICENSE)A logger with text formatting using
termcolor. [PYPI Package](https://pypi.org/project/termcolor-logger/)## Table of Contents
+ [Using the library](#using)
+ [Installing and using the library](#install_use)
+ [Manually install the library](#manual_install)
+ [Prerequisites](#prerequisites)
+ [Install the requirements](#installing_req)
+ [Update PyPI package](#pypi)
+ [License](#license)### Installing and using the library
First, you need to install the library either using pip:
```shell
$ pip install termcolor_logger
```Then, import it and use it like so:
```python
from termcolor_logger import ColorLoggerfancy_logger = ColorLogger(logger_name='FancyMain',
color='blue',
on_color='on_red',
attrs=['underline', 'reverse', 'bold'])ColorLogger.setup_logger(log_path="hi.log", debug=True, clear_log=True)
fancy_logger.info("You can customize the logger like this")
fancy_logger.info("You can customize each log message differently",
color="green", on_color="on_white", attrs=[])
```## Manually install the library
These instructions will get you a copy of the project up and running on your local machine for
development and testing purposes.You need to have a machine with
[anaconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) installed and
any Bash based shell (e.g. zsh) installed.```ShellSession
$ conda -V
conda 4.10.1$ echo $SHELL
/usr/bin/zsh```
All the installation steps are being handled by
the [Makefile](https://github.com/drkostas/termcolor-logger/blob/master/Makefile).First, modify the python version (`min_python`) and everything else you need in
the [settings.ini](https://github.com/drkostas/termcolor-logger/blob/master/settings.ini).Then, execute the following commands:
```ShellSession
$ make create_env
$ conda activate termcolor_logger
$ make dist
```Now you are ready to use and modify the library.
This is mainly for future reference for the developers of this project. First,
create a file called `~/.pypirc` with your pypi login details, as follows:```
[pypi]
username = your_pypi_username
password = your_pypi_password
```Then, modify the python version (`min_python`), project status (`status`), release version (`version`)
and everything else you need in
the [settings.ini](https://github.com/drkostas/termcolor-logger/blob/master/settings.ini).Finally, execute the following commands:
```ShellSession
$ make create_env
$ conda activate termcolor_logger
$ make release
```For a dev release, change the `testing_version` and instead of `make release`, run `make release_test`.
This project is licensed under the Apache License - see
the [LICENSE](https://github.com/drkostas/termcolor-logger/blob/master/LICENSE) file for
details.