From c87b0ca6d5721693b0a0046f6f153d72774062ac Mon Sep 17 00:00:00 2001 From: drkostas Date: Tue, 14 Dec 2021 22:18:49 -0500 Subject: [PATCH] Created Readme --- README.md | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..546555b --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +# Termcolor Logger + +[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://raw.githubusercontent.com/drkostas/termcolor-logger/master/LICENSE) + +## About + +A logger with text formatting using +termcolor. [PYPI Package](https://pypi.org/manage/project/termcolor-logger/releases/) + +## Table of Contents + ++ [Using the library](#using) + + [Installing and using the library](#install_use) + + [Creating a config file](#configuration) + + [Set the required environment variables](#env_variables) ++ [Manually install the library](#manual_install) + + [Prerequisites](#configuration) + + [Install the requirements](#installing_req) + + [Run the Unit Tests](#unit_tests) ++ [Continuous Integration](#ci) ++ [License](#license) + +## Using the library + +### 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 ColorLogger + +fancy_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. See deployment for notes on how to deploy the project on a live +system. + +### Prerequisites + +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 + +``` + +### Install the requirements + +All the installation steps are being handled by +the [Makefile](https://raw.githubusercontent.com/drkostas/termcolor-logger/master/Makefile). 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 and everything else you need in +the [settings.ini](https://raw.githubusercontent.com/drkostas/termcolor-logger/master/settings.ini). + +Finally, execute the following commands: + +```ShellSession +$ make create_env +$ conda activate termcolor_logger +$ make release +``` + +## License + +This project is licensed under the MIT License - see +the [LICENSE](https://raw.githubusercontent.com/drkostas/termcolor-logger/master/LICENSE) file for +details. + +Buy Me A Coffee