Skip to main content

A colorful logger for Python's applications.

Project description

Colorful logger for application

I. Installation

1. You can easily install it from pypi:

pip install hien_logger

2. Or you can also install it from source:

git clone https://github.com/hienhayho/hien_logger.git

cd hien_logger/

pip install -v .

Optional:

  • To make sure hien_logger was sucessfully installed, run this:
pip install pytest

pytest

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")

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.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hien_logger-0.0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd5f9367675c3c16b88f74365c0c7780dfbd001dd54e15af7938e4a3fc08d4d8
MD5 1a78a3bbbf645a7f256ffef924de5de6
BLAKE2b-256 375fcd3396da32b219c79072656c7ad73d49d61ffde64163fc1bb143b37e21af

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