Skip to main content

Termcolor Logger

GitHub license

About

A logger with text formatting using termcolor. PYPI Package

Table of Contents

Using the library

Installing and using the library

First, you need to install the library either using pip:

$ pip install termcolor_logger

Then, import it and use it like so:

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.

Prerequisites

You need to have a machine with anaconda installed and any Bash based shell (e.g. zsh) installed.

$ conda -V
conda 4.10.1

$ echo $SHELL
/usr/bin/zsh

Install the requirements

All the installation steps are being handled by the Makefile.

First, modify the python version (min_python) and everything else you need in the settings.ini.

Then, execute the following commands:

$ make create_env
$ conda activate yaml_config_wrapper
$ make dist

Now you are ready to use and modify the library.

Update PyPI package

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.

Finally, execute the following commands:

$ make create_env
$ conda activate yaml_config_wrapper
$ make release

For a dev release, change the testing_version and instead of make release, run make release_test.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Buy Me A Coffee

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termcolor-logger-1.0.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termcolor_logger-1.0.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file termcolor-logger-1.0.3.tar.gz.

File metadata

  • Download URL: termcolor-logger-1.0.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for termcolor-logger-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a395d6b5e285fc95ee2d3be3e67db97b3a0f7f99b800252a5a1da57c92e984a9
MD5 bf26e8daa5ecdb722807a7db025cb66e
BLAKE2b-256 db6467e9f1f500dfa02f3009f3e62770e98b2b14acb73995bbdc51e3c124f653

See more details on using hashes here.

File details

Details for the file termcolor_logger-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: termcolor_logger-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for termcolor_logger-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c8496ae902df3ac9d029a4f04ebe59b528900ba0399b543d057c84fd05353d64
MD5 0faa051b906f970bc506f8cd301e9573
BLAKE2b-256 34d192ddcf2bc138476f29f8287cddb4213600a3b23fc68a2d43c4508ca569a1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page