Skip to main content

A simple and flexible logging library for Python

Project description

zns-logging

A simple and flexible logging library for Python

Installation

pip install zns-logging

Usage

from zns_logging.ZnsLogger import ZnsLogger

logger = ZnsLogger(__name__, "DEBUG")

logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")

Output

[2025-01-26 23:22:06] [DEBUG   ] [__main__]: This is a debug message
[2025-01-26 23:22:06] [INFO    ] [__main__]: This is an info message
[2025-01-26 23:22:06] [WARNING ] [__main__]: This is a warning message
[2025-01-26 23:22:06] [ERROR   ] [__main__]: This is an error message
[2025-01-26 23:22:06] [CRITICAL] [__main__]: This is a critical message

Change Log

1.0.0

- Status: Yanked
- Reason: The `colorama` dependency was missing from `install_requires`, causing errors during logger usage.

1.0.1

- Status: Released
- Changes: Added `colorama` to `install_requires`.

1.0.2

- Status: Released
- Changes: Added description and other metadata to `Setup.py`.

1.0.3

- Status: Released
- Changes: Removed unnecessary variables from `Setup.py`.

1.0.4

- Status: Released
- Changes: Update `zns_logging.py` logic.

1.0.5 & 1.0.6 & 1.0.7

- Status: Yanked
- Reason: Unnecessary releases.

1.0.8

- Status: Released
- Changes: Rename `zns_logging.py` to `ZnsLogging.py` and update logic.

1.0.9

- Status: Released
- Changes: Update automatically create log directory.

1.1.0

- Status: Released
- Changes: Change function `get_logger` to class `ZnsLogger`.

1.1.1

- Status: Released
- Changes: Remove `ZnsLogging.py`.

1.1.2

- Status: Released
- Changes:
    - Update auto create log directory.
    - `log_and_raise` now does not need to pass the caller's name.

1.1.3

- Status: Released
- Changes:
    - Swap the order of the StreamHandler and FileHandler in the logger.
    - Integrate the `log_and_raise` function into the `ZnsLogger` class.
    - Fix logic in `LogConsoleFormatter`.

1.1.4

- Status: Released
- Changes: Create `LogHandlerFactory` class to create log handlers dynamically.

1.1.5

- Status: Released
- Changes: Automatically create log directory if it does not exist.

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.

zns_logging-1.1.5-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file zns_logging-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: zns_logging-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for zns_logging-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2e563fcafbce3085600e683953647ade83e0bf4543738dafbbd2f259a14582a7
MD5 e47723e7bba36bf5e236910b8e677081
BLAKE2b-256 a804427778ec4b3725031cd89800c23ae2f0276fdbc0fc4c051ce3b1a32ab6e7

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