Skip to main content

anlogger

A python3 module to assist in setting up logging.

Install

python3 -m pip install anlogger

Usage

from anlogger import Logger
logger_obj = Logger(name="appname", default_loglevel="INFO", fmt=None, syslog=None, syslog_facility=None, log_to_console=True, console_stream='stderr')
logger = logger_obj.get()
logger.info("Message on info-level")

name is application name used in logging (REQUIRED).

default_loglevel is the logging level which is used unless LOGLEVEL environment variable is set.

fmt is the format used for formatting the logger. Se python's logging module documentation for formattion options.

syslog is the syslog configuration. Set to True to use local syslog, or a tuple of ("ipaddress-string", port-int) for remote logging.

syslog_facility is one of well-known syslog facilities. If syslog is used but syslog_facility is not set, the user facility is used by default.

log_to_console defines whether the logging is also outputted to the console. Default is True.

console_stream defines which output stream to use for console logging. Accepted values are stderr (default) and stdout.

See logger.Logger class code for additional details.

Release files for anlogger 1.2.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 anlogger 1.2.1
File Size Uploaded
anlogger-1.2.1.tar.gz 3.2 kB Details

Built distribution (wheel)

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

Total release size: 6.8 kB

Release files / anlogger-1.2.1.tar.gz

Download URL anlogger-1.2.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6f05333aba06ee13d62e3130373e7ffa84056322a43e04e29f00cdffd7d404e1
BLAKE2b-256 checksum
How to use checksums
b79e2e7851a466b46ec030786596dcf407339a5afc5f5298ff827c22e2746d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / anlogger-1.2.1-py3-none-any.whl

Download URL anlogger-1.2.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20f9f285b583b47db4fae1f5a08d1adc5566b7d1bb618f580427e51d7882c13e
BLAKE2b-256 checksum
How to use checksums
2ba4e9ad90a3373364667af5526dab15d7c7626c24c8524fedf3f5eb0857576f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

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