Skip to main content

A colorful logger for Python's applications.

Project description

Colorful logger

Downloads GitHub CI License

:wrench: I. Installation

1. You can easily install it from pypi:

pip install hien_logger

2. You can also install it from source:

pip install git+https://github.com/hienhayho/hien_logger.git
  • Or
git clone https://github.com/hienhayho/hien_logger.git

cd hien_logger/

pip install -v .

# Optional: Test if installed successfully.
pip install pytest
pytest

:tada: II. Usage

  • You can use it as a console logger:
from hien_logger import get_formatted_logger

logger = get_formatted_logger(name="hien_logger")

logger.info("Hello World")
  • Or you can log it to a file:
from hien_logger import get_formatted_logger

logger = get_formatted_logger(
    name="hien_logger",
    file_path="test.log"
)

logger.info("Hello World")
  • You can include date of this file log with include_date=True. Then the date will be included in file log name.
from hien_logger import get_formatted_logger

logger = get_formatted_logger(
    name="hien_logger",
    file_path="test.log",
    include_date=True
)

logger.info("Hello World")
  • Log all to one global file:
from hien_logger import get_formatted_logger

logger = get_formatted_logger(
    name="hien_logger",
    global_file_log=True
)

logger.info("Hello World")
  • You can set datetime to your timezone:
from hien_logger import setup_timezone

setup_timezone("Asia/Ho_Chi_Minh")

:book: III. LICENSE

hien_logger is under MIT LICENSE.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hien_logger-0.0.3.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file hien_logger-0.0.3.1-py3-none-any.whl.

File metadata

  • Download URL: hien_logger-0.0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for hien_logger-0.0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0b3ebd10a2450affee6d08d0b1144f56cd69951d11f0c3faeaecb84f1da632
MD5 ccbb8b0d07b5e4f58797cf7bd4ee87ad
BLAKE2b-256 f96d13815a6bfdb8177d2e9acda1362891f174491521fd097729fb4d9613b58f

See more details on using hashes here.

Supported by

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