New Features
- What feature(s) did you add?
Added a basic logging functionality that makes it possible to see problems occuring or help users when they have problems executing commands.
This also is a helpful tool for the other Admins to check upon.
This can also be used further to enhance the user experience with the bot by eliminating the root causes of standard problems as well as improve stability by being able to have more informations in case of a unexpected shutdown of the program.
This is how the logfile is currently looking like:
- How did you implement it/them?
I added the logging functionality by directly using the logging module that python brings along by simply importing it.
import logging
logger = logging.getLogger("DachBot")
logger.setLevel(logging.INFO)formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logHandler = logging.FileHandler("Dachbot.log")
logHandler.setLevel(logging.INFO)
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)
After that Iam using commands like
logger.info("information to log")
to create entries in the logfile.
This is solving one of the issues currently listed on Github.
Commit and Merge
This is the commit that I have done and this is the merged pull request
Project and Issues on Github
The Project and Issues page on Github has been updated accordingly.
Thanks alot for your time !
Yours
Jan
Posted on Utopian.io - Rewarding Open Source Contributors