Skip to main content

A log aid for you.

Project description

LogAid

A log aid for you.

wait development

1. add jsonlogger
2. add rotation

Installation

pip install logaid

Usage

just print

import logaid as log

log.debug('hello world')
log.info('hello world')
log.warning('hello world')
log.success('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.5.0.tar.gz (5.6 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.5.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for logaid-1.5.0.tar.gz
Algorithm Hash digest
SHA256 4156a943a11d69ec444c5900b03d8433e1ac6608094967629ebc38bec76d6c73
MD5 2011ca2c10e2c3c27840fb2b37524dfb
BLAKE2b-256 3083a78bc60766108a3532f53fab717d4b6f8e3107550c590c537df72e815bae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logaid-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e226f11b7c9e8ac1494173f83aa203acac0db727134a4f85e4c63e0432bdeb17
MD5 5068d305000ec56044e90dac6686bfe9
BLAKE2b-256 4992b24dea41aecd2a3041bc75321e0445a6c5529d85d2cda79cb18d10c2b093

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