Skip to main content

Ezlogger

This package is made to easily create logger that is suit for most of the situations, including following functions:

  • automatically create "log" folder under the work directory
  • the log information will be displayed on std, and will also be stored in the .log file
  • allow user to set the information level for both stdout and log file

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 'logfile.log'.

Returns:

  • logger <logging.Logger>: The initialized logger instance.

Useage:

# Imports
import sys, logging, traceback
from ezlogger_xzf import initialize_logger
from pathlib import Path

logger = initialize_logger(stdout_level='INFO', file_level='DEBUG', log_file='logfile.log')

# Error & Debug (need to import traceback)
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")

Release files for ezlogger-xzf 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezlogger-xzf 0.0.1
File Size Uploaded
ezlogger_xzf-0.0.1.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ezlogger-xzf 0.0.1
File Interpreter ABI Platform
ezlogger_xzf-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / ezlogger_xzf-0.0.1.tar.gz

Download URL ezlogger_xzf-0.0.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f3a90dc77ccd41bbff3203424f1756eabb9002fba941fb0e10ce70e2065c114
BLAKE2b-256 checksum
How to use checksums
a62b2b50866cdcc4178c6c5463f74303c1cf87fe5db69398334fc9535bdeabff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release files / ezlogger_xzf-0.0.1-py3-none-any.whl

Download URL ezlogger_xzf-0.0.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65d010cc7d57dce50ca333e3ba3b2495dcdcd2f1f301527908964e5f4fa7cb57
BLAKE2b-256 checksum
How to use checksums
2b18dbb9c1bf358fc740022da99824e2a355783ff0cc3ce0352eec4dc7a9d44d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page