Skip to main content

cfglog: Configurate Logging Easily

cfglog provides an easy way to setup logging. It supports the configuration of datetime in the logging system, which is useful when you want to share the time spent on the program's execution without revealing when the program was run.

Installation

pip install --upgrade cfglog

Usage Example

>>> import datetime as dt
>>> import logging
>>> import sys
>>> import cfglog
>>> cfglog.basicConfig(
...     level=logging.DEBUG,  # logging when level >= DEBUG
...     format="%(asctime)s [%(levelname)s] %(message)s",
...     datefmt="%H:%M:%S",
...     datetime=dt.datetime(2000, 1, 1),  # set current datetime in logging system as 2000-01-01T00:00:00
...     stream=sys.stdout,  # write to stdout rather than stderr
...     force=True,  # overwrite existing configuration
... )
>>> logging.debug("This is a debug message.")
00:00:00 [DEBUG] This is a debug message.
>>> logging.info("This is an info message.")
00:00:00 [INFO] This is an info message.
>>> logging.warning("This is a warning message.")
00:00:00 [WARNING] This is a warning message.
>>> logging.error("This is an error message.")
00:00:00 [ERROR] This is an error message.
>>> logging.critical("This is a critical message.")
00:00:00 [CRITICAL] This is a critical message.

APIs

class TimeoffsetFormatter: An extended version of logging.Formatter that supports datetime configuration via the parameter datetime.

Function basicConfig(): An extended version of logging.basicConfig() that supports datetime configuration via the parameter datetime, and some features in newer/future version of Python such as style, handlers, force, encoding, and errors.

Metadata

Release files for cfglog 1.0.0

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

Source distribution (sdist)

Source distribution for cfglog 1.0.0
File Size Uploaded Provenance
cfglog-1.0.0.tar.gz 4.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cfglog 1.0.0
File Interpreter ABI Platform
cfglog-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / cfglog-1.0.0.tar.gz

Download URL cfglog-1.0.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e8245f7e12e64e75225f0aa76f2b6170e18a9272d5c27785215ee3c2b2a88a96
BLAKE2b-256 checksum
How to use checksums
8c8db12e0d5359255579c3f641aa1a81e9a001200a701442d4db89a3a4d2231f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / cfglog-1.0.0-py3-none-any.whl

Download URL cfglog-1.0.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b20266148f1c6a7a14c0a1ed812a6909b6f15457668806728657996f7b730059
BLAKE2b-256 checksum
How to use checksums
a1b111c4ab9a57cd5b3d9ae58a095802258369c1cb1de229334e8b3f148f8255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for cfglog 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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