Skip to main content

Logutil

(Extremely) easy initialization for logging and loguru

Why

This packages makes it (extremely) easy to send logging and loguru logs to

  • streams
  • files
  • sentry
  • pushover
  • slack

Installation

  • Logging only: pip install logutil
  • ... + loguru: pip install logutil[loguru]
  • ... + pushover/sentry/slack: pip install logutil[notifiers]
  • ... + loguru + pushover/sentry/slack: pip install logutil[all]

Examples

Standard python logging

from logutil import init_logging, get_logging_logger
init_logging(
    name='data_feeds',
    sentry_on=True,
    sentry_dsn='<your sentry dsn string>',
    sentry_breadcramp_level='INFO',
    sentry_event_level='WARNING',
)
logger = get_logging_logger('data_feeds')
logger.info('Test INFO message (logging)')
logger.warning('Test WARNING message (logging)')
2020-07-19T12:59:18.740Z data_feeds INFO: Test INFO message (logging)
2020-07-19T12:59:18.740Z data_feeds WARNING: Test WARNING message (logging)

Loguru

from logutil import init_loguru, get_loguru_logger
init_loguru()
logger = get_loguru_logger(
    slack_on=True,
    slack_level='WARNING',
    slack_webhook_url='<your slack app webhook url string>',
)
logger.info('Test INFO message (loguru)')
logger.warning('Test WARNING message (loguru)')
2020-07-19T12:56:20.771Z __main__ INFO: Test INFO message (loguru)
2020-07-19T12:56:20.771Z __main__ WARNING: Test WARNING message (loguru)

Notes

  • Formatting is ignored for sentry notifications with logging

Metadata

Release files for logutil 0.1.11

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

Source distribution (sdist)

Source distribution for logutil 0.1.11
File Size Uploaded Provenance Actions
logutil-0.1.11.tar.gz 7.6 kB Without provenance Details for logutil-0.1.11.tar.gz

Built distribution (wheel)

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

Total release size: 16.5 kB

Release files / logutil-0.1.11.tar.gz

Download URL logutil-0.1.11.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ef6ff83af406462720845490b7878af728c573b2c48c6410290e23a99115bede
BLAKE2b-256 checksum
How to use checksums
34504dc969132057eaa3d8413f4c30d31822a624f42e6caf6e9b6cc3971cf6b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1015-azure

Release files / logutil-0.1.11-py3-none-any.whl

Download URL logutil-0.1.11-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d161574616c9e04bab18bdc97ba05c51814310907c7c1051f44e4e9d993a4f2
BLAKE2b-256 checksum
How to use checksums
2ee52fa436d3afe836f079b7c55c83112906762a93daea5a083a486d6ad3cbbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1015-azure

Security for logutil 0.1.11

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.

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