Skip to main content

A log aid for you.

Project description

LogAid

A log aid for you.

Installation

pip install logaid

Usage

just print

from logaid import log

log.info('hello world')
log.warning('hello world')
log.error('hello world')
log.fatal('hello world',123,{},[],False)

or

import logaid

logaid.info('hello world')
logaid.warning('hello world')
logaid.error('hello world')
logaid.fatal('hello world',123,{},[],False)

image

open super print

from logaid import log
log.init(print_pro=True)

print("Hello World")

image

auto_save

from logaid import log
log.init(level='DEBUG',save=True)

log.info('hello world')

save as filename and not print

from logaid import log
log.init(level='DEBUG',filename='test.log',show=False)

log.info('hello world')

define format

from logaid import log
log.init(level='INFO',format='%(asctime)s %(levelname)s %(pathname)s %(lineno)d: %(message)s')

log.info('hello world')

image

define color

from logaid import log
color = {
    'DEBUG':'gray',
    'INFO':'green',
    'WARNING':'yellow',
    'ERROR':'red',
    'FATAL':'violet',
}
log.init(level='DEBUG',color=color)

log.debug('hello world')
log.info('hello world')
log.warning('hello world')
log.error('hello world')
log.fatal('hello world',123,{},[],False)

image

send email

from logaid import log
mailer = {
        'host': 'smtp.qq.com',      
        'token': 'xxxxxxxxxxxx',    # IMAP/SMTP code
        'nickname':'LogAid',    
        'sender': 'xxxxxx@qq.com',
        'receivers': ['xxxxxx@qq.com'],
        'subject': 'A log aid for you.',
        'open_level': ['ERROR','FATAL']   # More than WARNING valid.
    }
log.init(level='ERROR',mailer=mailer)

log.error('Exec appear error.')
log.email('Send email tip.')

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

logaid-1.2.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

logaid-1.2.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file logaid-1.2.5.tar.gz.

File metadata

  • Download URL: logaid-1.2.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for logaid-1.2.5.tar.gz
Algorithm Hash digest
SHA256 d3c98290eb582a1a594c5022e5f280c57a0aaba6628c3e20617e628ff68adc05
MD5 d792a0fd6c476bb2fde7f908f3be3f19
BLAKE2b-256 8a521b4a225f2c1eceec20bbbeb68e5b2ab298ba169b85922864a4df464b20ae

See more details on using hashes here.

File details

Details for the file logaid-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: logaid-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for logaid-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9b90547a73a6f6f2d5609fb60aed1ffdf8ee81b2d986531c9f202827acdc6a
MD5 30095190f1a63d960cebf9c7b0f6a72a
BLAKE2b-256 aac873e3f1ef9e5a667b2ba2101663db1883c7ed48b9d9894f208120a02e0cd4

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