LogAid
LogAid is a Python library designed to make logging enjoyable.
Have you ever felt too lazy to configure a proper logger and just defaulted to using print()? I know I have. But logging is crucial for any application and really simplifies debugging. With LogAid, you’ve got no excuse not to log from the start—it’s as easy as from logaid import logger.
This library aims to ease the pain of Python logging by offering a range of helpful features that address the common pitfalls of standard loggers. Logging in your app should be second nature, and LogAid strives to make that process both easy and powerful.
wait development
1. add jsonlogger
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)
click jump into code line
open super print
from logaid import log
log.init(print_pro=True)
print("Hello World")
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')
Split the log files by day
from logaid import log
log.init(filename='test.log',rotating='day')
log.info('hello world')
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)
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.')
Release files for logaid 1.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logaid-1.5.3.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logaid-1.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / logaid-1.5.3.tar.gz
| Download URL | logaid-1.5.3.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0513e07b06a00b8b8f6e098a72d9838b76f5c76832f4150df1a7a87a93f98614
|
|
BLAKE2b-256 checksum How to use checksums |
c7f84f9c1e5c934cbac3795c95a6b1dd9749e8be2ca2ef687e1c345687a0a25c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / logaid-1.5.3-py3-none-any.whl
| Download URL | logaid-1.5.3-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df3021bb275bd501b03e06d66fefc74c7d1c56c671d522c54448a9dcbd56d8b5
|
|
BLAKE2b-256 checksum How to use checksums |
28c9c077d69d21e59e93566c2f2936fafee86460505efacef78b922159eaed4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|