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
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)
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')
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.')
Project details
Release history Release notifications | RSS feed
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.4.0.tar.gz
(5.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logaid-1.4.0.tar.gz.
File metadata
- Download URL: logaid-1.4.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a445fb6c70972b80c18c08bc3e95166d639f57282006990141f89d5f0e6fb8ac
|
|
| MD5 |
ede46d7c1d2964d3ed872a61d6f7806c
|
|
| BLAKE2b-256 |
1a137f60f58c7374f75ef76b75cb3ab9ea1be008e91624741b1b41c968fa611c
|
File details
Details for the file logaid-1.4.0-py3-none-any.whl.
File metadata
- Download URL: logaid-1.4.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5e0a0658044d5c5d3c059db06f1c87f0beb2c158d2513700ec4613960421cff
|
|
| MD5 |
bc9e42bf38a79adc4ad0885023c88366
|
|
| BLAKE2b-256 |
7e44ff0dd847cc20d96dfb2db09f6f26265e8aa2bdb90ca65c2c05b49af2b6cb
|