Skip to main content

A logger utility for python application

Project description

HLogger

HLogger is a utility module that provides a flexible logging solution for Python applications. It allows you to easily create and manage loggers with both file and stream handlers.

Installation

You can install HLogger using pip:

$ pip install hlogger

Usage

Basic Logger Setup

from hlogger import create_logger

# Create a logger
logger = create_logger("app_logger", "app_log.log")

# Log messages
logger.info("Application started")

Change Log File

from hlogger import create_logger

# Create a logger
logger = create_logger("app_logger", "app_log.log")

# Log messages
logger.info("Application started")

# Change the log file dynamically
logger = create_logger("app_logger", "new_app_log.log")

# Log messages with the new log file
logger.warning("Application warning")

Get Logger

from hlogger import create_logger, get_logger

# Create a logger
logger = create_logger("app_logger", "app_log.log")

# Create another logger
logger = create_logger("app_logger2", "app_log2.log")

# Set logger to the previous one and log messages to it
logger = get_logger("app_logger")
logger.error("Application error")

Project details


Download files

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

Source Distribution

hlogger-1.2.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

hlogger-1.2.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

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