a simple logging tool(support file,email,dingtalk) ,Multithreading and Multi process safe
Project description
Function description
a simple logging tool(support file,email,dingtalk) ,mutil thread and process safe
Version description
- Supported version: Python 3.0+
Pip installation
pip install py-log
Demo
# log write file
from py_log import LogManager
logger = LogManager('test1').get_logger_and_add_handlers(log_filename='test1.log')
logger.info('aaaa')
logger.debug('bbbb')
logger.warning('cccc')
logger.error('dddd')
# log send dingding
from py_log import LogManager
ding_talk_token = 'xxxxxxxx'
logger = LogManager('ding_talk_test').get_logger_and_add_handlers(ding_talk_token=ding_talk_token)
logger.info('钉钉调试')
from py_log import LogManager
from py_log.log_manager import MailHandlerConfig
# log send dingding
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')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-log-1.6.tar.gz
(20.5 kB
view details)
Built Distribution
py_log-1.6-py3-none-any.whl
(24.4 kB
view details)
File details
Details for the file py-log-1.6.tar.gz
.
File metadata
- Download URL: py-log-1.6.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using 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.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd8b44c20d6e57d7fad870cd9b7608f90a6bb012832ece3d08c357a254b3545 |
|
MD5 | 53401a593895be99ef08bc34ea7664a6 |
|
BLAKE2b-256 | 8e8c2f546a6bf2cf26984c7de4e5567ade7934940dda27e8f3861cc379be1d99 |
File details
Details for the file py_log-1.6-py3-none-any.whl
.
File metadata
- Download URL: py_log-1.6-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using 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.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03bbb4541f69aa6609c0de5ded6e0147e297da41a9bca8ff1b14df8a519c4476 |
|
MD5 | 536769f32d259574bc1f57637ce59aac |
|
BLAKE2b-256 | 652991a0eadba34cb641e2b7fba1a549a8d9557442159d239092f47944d53ded |