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
sentrynotifications withlogging
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logutil-0.1.11.tar.gz
(7.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logutil-0.1.11.tar.gz.
File metadata
- Download URL: logutil-0.1.11.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef6ff83af406462720845490b7878af728c573b2c48c6410290e23a99115bede
|
|
| MD5 |
adfbd044d59043ee02ea19c6bdee34f8
|
|
| BLAKE2b-256 |
34504dc969132057eaa3d8413f4c30d31822a624f42e6caf6e9b6cc3971cf6b6
|
File details
Details for the file logutil-0.1.11-py3-none-any.whl.
File metadata
- Download URL: logutil-0.1.11-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d161574616c9e04bab18bdc97ba05c51814310907c7c1051f44e4e9d993a4f2
|
|
| MD5 |
789e2fe8580b488d1d65ea951e9f7f91
|
|
| BLAKE2b-256 |
2ee52fa436d3afe836f079b7c55c83112906762a93daea5a083a486d6ad3cbbf
|