Package to create log files with using TimedRotatingFileHandler
Project description
python_custom_logging
logpath = "YOUR LOG PATH/LOG_FILE_NAME.log"
loggername = "YOUR LOGGER NAME"
logformat = ("%(asctime)s [%(levelname)s]: %(lineno)d : %(message)s ") --YOUR LOG FORMAT
log_level = logging.INFO -- YOUR LOG LEVEL
logfilehandlertime = "H" -- logfilehandlertime (H,M,S)
interval = 1 - intreval of time 1 hour,1 sec ,1 minutes
backupCount=0 file we keep of logs if 0 mean all log file will be there and if set to 2 then latest 2 log file will be there and rest will be deleted
Create obj before use
from python_custom_logging import *
logging_config_obj=logging_config(logpath,loggername,logformat,log_level,logfilehandlertime,interval,backupCount).create_log()
For Example:
logging_config_obj.info('YOUR LOGS')
logging_config_obj.error('YOUR LOGS')
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 Distributions
Built Distribution
Hashes for python_custom_logging-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02ad96b612df0893ce07f1b7b4a84ed4d8a3d4dcb1c55539f58da2253724e249 |
|
MD5 | d43fb78fd6dbd613fdc2c70ab8646382 |
|
BLAKE2b-256 | 5cc629adc74acac8edeeda2cd852ad576a2903662993dfe8074f18d47ed01828 |