Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

超简单的日志模块,导入即用

Project description

ilogger

超简单的日志模块,导入即用

如何使用它?

>>> pip install ilogger
from ilogger import logger

# 直接使用,默认级别为 INFO
logger.debug('this is debug message')
logger.info('this is info message')
[2019-09-24 19:54:23,544]   INFO: this is info message
from ilogger import logger

# 设置 logger 级别
logger.setLevel(logger.DEBUG)

logger.debug('this is debug message')
logger.info('this is info message')
logger.warning('this is warning message')
logger.warn('this is warning message')
logger.error('this is error message')
logger.critical('this is critical message')
[2019-09-24 19:54:23,544]  DEBUG: this is debug message
[2019-09-24 19:54:23,544]   INFO: this is info message
[2019-09-24 19:54:23,544]WARNING: this is warning message
[2019-09-24 19:54:23,544]WARNING: this is warning message
[2019-09-24 19:54:23,544]  ERROR: this is error message
[2019-09-24 19:54:23,544]CRITICAL: this is critical message
from ilogger import logger

# 设置 logger 格式
logger.setFormatter(fmt='[%(asctime)s]%(levelname)7s[%(filename)s:%(lineno)s]: %(message)s')

logger.debug('this is debug message')
logger.info('this is info message')
[2019-09-24 19:54:23,544]  DEBUG[demo.py:21]: this is debug message
[2019-09-24 19:54:23,544]   INFO[demo.py:22]: this is info message

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ilogger, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size ilogger-0.0.2.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page