Skip to main content

a simple tool that logs what is printed on the screen, and emails the logs to you

Project description

Introduction

This is a tool that logs everything your program printing on the screen, and sends you an email when the program is finished or terminated.

Usage

First, create ~/.autosend.yaml using the following template and modify the configs.

#  =========== autosend yaml template ============
# specify the email SMTP server
username: "username"
password: "password"
server: smtp.example.com
port: 25
tls: False
timeout: 15

# specify the email subject format, where: 
# {path} implies the work_dir running the python script,
# {curtime} implies the current date and time
# {status} implies the log type (may be running or complete) 
subject_format: "【符合保密要求,可在手机端查阅】{path}日志 [{curtime}] [{status}]"

# specify the email sender's and receivers' addresses
sender: "example@example.com"
receivers: 
- "example@example.com"

# send logs by email only if the program runs after the specific seconds
send_after_seconds: 3600

# send logs by email EVERY specific seconds if the program is keep running
send_periods: 86400

Then add the following line in your code:

import autosend

After the program is finished or after a specific time, you will get an email like:

【符合保密要求,可在手机端查阅】Python Scripts日志 [2023-05-14 13:45] [completed]
xx send to xx 2023-05-14 13:46:27

 start_time: 2023-05-14 13:45
last update: 2023-05-14 13:46
   work_dir: D:\Users\A\Documents\Python Scripts
       args: test.py
================= last 100 lines of the log =================
1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'date' is not defined
1684043182.6202037

1 attachments

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

autosend-0.0.2.win-amd64.zip (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autosend-0.0.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file autosend-0.0.2.win-amd64.zip.

File metadata

  • Download URL: autosend-0.0.2.win-amd64.zip
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for autosend-0.0.2.win-amd64.zip
Algorithm Hash digest
SHA256 3be998e46cfd4aefd63adcfd5d684f11e6d75ef50bcb2f4e1ee8900365f4de65
MD5 d1ef513485f3bd5022276a0ebcb52170
BLAKE2b-256 883b60924b906e692173f0b2a34d8cd6586861c0a69b2aba9f1dcbc2d8b4798f

See more details on using hashes here.

File details

Details for the file autosend-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: autosend-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for autosend-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9e0cf087404dabe61c6957161911908be8105fcc12f9864c3ef63c26d95c13
MD5 b8684b473c82fe5bb7026dec43f550dc
BLAKE2b-256 2df4fd54e70f93d4fcacacce77710b79ab21bd4205068a58e88d94837e7885ac

See more details on using hashes here.

Supported by

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