Skip to main content

A log aid for you.

Project description

LogAid

A log aid for you.

wait development

1. add log.success

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

click jump into code line

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.3.9.tar.gz (5.1 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.3.9-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for logaid-1.3.9.tar.gz
Algorithm Hash digest
SHA256 c48ce1a14b73c7aaaace6ac5af74358fd64db13c0a56067ff91bdffed28a0b01
MD5 73a7355e79598ea1621335950adb9d2e
BLAKE2b-256 600ca5b0ac838066678f3dc2ef2b9fd8b797dd8cedca249187858ed6ca236e27

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for logaid-1.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e3b3717c3f0e3239ec77210f77a0a2dd37279b0b085d6a99d8916e8489291f
MD5 2e604d0a8fae3014be87a2e94bc934cc
BLAKE2b-256 e7a5c7f4bef79b19778ce730cb89ba51ba61f890c032a7353cee0311b4b8f16b

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