app-logger
Application Logger
Base logging class for Python applications
➜ Used in Tera retail servers
Project: app-logger
Contact:
You can reach out to us over...
E-Mail | Website | Twitch | Discord
Package Content
- High-Performant Python logging class
- Ready to use for any Python application
- Descriptive in-file comments to adjust
Package Requirements
- Python 3.10
Package Configuration
Base Logger Setup
Open /config.ini
and set:
[loggers]
keys=root
[logger_root]
level=DEBUG
handlers=screen,file
Log Formatting Setup
Open /config.ini
and set:
[formatters]
keys=simple,verbose
[formatter_simple]
format=[%(asctime)s] [%(levelname)s] %(name)s: %(message)s
[formatter_verbose]
format=[%(asctime)s] [%(levelname)s] [%(filename)s %(name)s %(funcName)s (%(lineno)d)]: %(message)s
File and Console Log Setup
Open /config.ini
and set:
[handlers]
keys=file,screen
[handler_file]
class=handlers.TimedRotatingFileHandler
interval=midnight
backupCount=5
formatter=simple
level=DEBUG
args=('logs/logger.log',)
[handler_screen]
class=StreamHandler
formatter=simple
level=DEBUG