Skip to main content

Function description

py-log is a simple logging tool(support file,email,dingtalk, wechat) ,mutil thread and process safe

Version description

  • Supported version: Python 3.0+

Pip installation

pip install py-log

Demo

# log console 
from py_log import get_logger

log = get_logger('test')
log.info('123')
# log write file
from py_log import get_logger

logger = get_logger('test1', log_filename='test1.log')
logger.info('aaaa')
logger.debug('bbbb')
logger.warning('cccc')
logger.error('dddd')
# log send dingding
from py_log import get_logger

ding_talk_token = 'xxxxxxxx'
logger = get_logger('ding_talk_test',ding_talk_token=ding_talk_token, at_mobiles=('13790000000', '13790000001'))
logger.info('钉钉调试')
# log send wechat
from py_log import get_logger
logger = get_logger('weichat_test', agentid='xxx', at_users='aa|bb', corpid='yyy', corpsecret='zzz')
logger.info('企业微信通知')
# log send email
from py_log import LogManager
from py_log.log_manager import MailHandlerConfig

mail_config = MailHandlerConfig()
mail_config.mailhost = ('smtp.sohu.com', 465)
mail_config.fromaddr = 'aaa@sohu.com'
mail_config.toaddrs = 'bbb@qq.com'
mail_config.credentials = ('mail_username', 'mail_password')
logger_mail = LogManager('log_mail_test').get_logger_and_add_handlers(mail_handler_config=mail_config,
                                                                          is_add_mail_handler=True)
logger_mail.info('test send mail content')

Metadata

Release files for py-log 2.5

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

Source distribution (sdist)

Source distribution for py-log 2.5
File Size Uploaded Provenance Actions
py-log-2.5.tar.gz 20.7 kB Without provenance Details for py-log-2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-log 2.5
File Interpreter ABI Platform Actions
py_log-2.5-py3-none-any.whl Python 3 none any Details for py_log-2.5-py3-none-any.whl

Total release size: 45.5 kB

Release files / py-log-2.5.tar.gz

Download URL py-log-2.5.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f9054848d34798376eb3e8e772b828b23db0a94cbc29fbfcd3ea61d701fb613b
BLAKE2b-256 checksum
How to use checksums
50434a5afd3ed1aab69bb6ea53cfc4161febc6bfd2f1edfb61128c63508e30a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.4.2 requests/2.24.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.1

Release files / py_log-2.5-py3-none-any.whl

Download URL py_log-2.5-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbaff5b3c6ee684da2f9466ccd966293e77d2f70008af6bbd80dd4ac0b124c9d
BLAKE2b-256 checksum
How to use checksums
b895d260065b558f35588121055d2fe4d49383f3a158e300042e13c4e1052e2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.4.2 requests/2.24.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.1

Security for py-log 2.5

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