Easily create useful logger.
Project description
Exzlogger
Extremely Easy Logger
This package is made to easily create logger that is suit for most of the situations, including following functions:
- allow user to set log directory
- the log information will be displayed on stdout, and will also be stored in the .log file
- allow user to set the information level for both stdout and log file
- nicely formatted log information, including the timestamp and information type
Parameters
stdout_level<str>: The log level to be used for stdout ('INFO', 'ERROR', 'DEBUG', or 'WARNING'), Defaults to 'INFO'.file_level<str>: The log level to be used for the log file ('INFO', 'ERROR', 'DEBUG', or 'WARNING'), Defaults to 'DEBUG'.log_file<str>: The path and name of the log file to write the log messages, defaults to 'log/log.log'.
Returns
logger<logging.Logger>: The initialized logger instance.
Dependencies
- pathlib
- logging
- sys
Useage
# Imports
from exzlogger import initialize_logger
logger = initialize_logger(stdout_level='INFO', file_level='DEBUG', log_file='logfile.log')
# Error & Debug (suggest to import traceback for debug)
logger.error(f"[func_name]: error message<{e}>")
logger.debug(f"[func_name]: error message<{e}>\n**********\n{traceback.format_exc()}**********")
# Info
logger.info(f"[func_name]: message")
# Warning
logger.warning(f"[func_name]: warning message")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
exzlogger-0.0.2.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file exzlogger-0.0.2.tar.gz.
File metadata
- Download URL: exzlogger-0.0.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78256463fe63ebccf7d831a08e2527588edf1efe23ae34ee89733a90c2233649
|
|
| MD5 |
be36ae3621c5eddd32bfc06147278b17
|
|
| BLAKE2b-256 |
e4f8944ce3aa53cd33a942af46cb29fc0afc509b71be2513a03d5801ac1c0f83
|
File details
Details for the file exzlogger-0.0.2-py3-none-any.whl.
File metadata
- Download URL: exzlogger-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ceb0a1fb5328a826958aa176e1f5847b079a30e14d8ad6a9bfed11176c337da
|
|
| MD5 |
4603eb0a9b962ad388b38e26c2244d02
|
|
| BLAKE2b-256 |
93d1020876735f66e93aead66828ad579b921fef658daf501f08ca07d06e09c1
|