Metadata-Version: 2.2
Name: hien_logger
Version: 0.0.3.0
Summary: A colorful logger for Python's applications.
Author-email: hienhayho <hienhayho3002@gmail.com>
Project-URL: Homepage, https://github.com/hienhayho/hien_logger
Project-URL: Issues, https://github.com/hienhayho/hien_logger/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.8
Requires-Dist: pytz>=2024.2
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: pytest>=8.3.4

# Colorful logger for application

## I. Installation

**1.** You can easily install it from pypi:

```bash
pip install hien_logger
```

**2.** Or you can also install it from source:

```bash
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:

```bash
pip install pytest

pytest
```

## II. Usage

- You can use it as a console logger:

```python
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:

```python
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.

```python
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:

```python
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:

```python
from hien_logger import setup_timezone

setup_timezone("Asia/Ho_Chi_Minh")
```

## III. LICENSE

`hien_logger` is under [MIT LICENSE.](./LICENSE)
