Skip to main content

带发邮件的loguru包装,支持全部loguru功能和邮件发送功能

Project description

eloguru: email for loguru

带邮件功能的loguru

install

  • clone source
git clone https://github.com/425776024/eloguru.git
  • pip
pip install eloguru

des

Loguru with mail function

带邮件功能的loguru

  • setting elogger.mail_config , then all operations are the same as loguru
  • then all the loguru logs will be sent to the mailbox:elogger.mail_config.receive_emails

config mail server

use

from eloguru import eloguru

eloguru.mail_config.sender_email = "Your email"
eloguru.mail_config.sender_email_passwd = "Your email Authorization code"
eloguru.mail_config.sender_email_mailserver = "Your email server, like: smtp.163.com"
eloguru.mail_config.sender_email_mailserver_port = "Your email server's port , like : 25"
eloguru.mail_config.title = "Your email message title , like : this is a log message title"
eloguru.mail_config.body = "Your email message content template , like : <br/>#msg<br/> (#msg Will be replaced by log message)"
eloguru.mail_config.receive_emails = [
  "Your email send to Email account 1",
  "Your email send to Email account 2",
]

# All operations are the same as loguru
eloguru.add('a.log', rotation='50 MB')
eloguru.add('a.log')
eloguru.error('error', email=True)
eloguru.debug('debug')
eloguru.info('info')
eloguru.success('success', email=True)

# then all the above logs will be sent to the mailbox:'eloguru.mail_config.receive_emails'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eloguru-0.0.2.tar.gz (5.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page