DACH-Support Discord/Steem Bridge - Added logging functionality

in #utopian-io6 years ago (edited)

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:
log

  • 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

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @vladimir-simovic, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Was genau macht der DACH-bot?? Danke, LG

Beschreibt der gute @jedigeiss hier

That good!! That is the goal every day to improve and help the community.

Hey @jedigeiss I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63493.34
ETH 2578.53
USDT 1.00
SBD 2.79