Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/logging #240

Merged
merged 6 commits into from
Mar 31, 2021
Merged

Feat/logging #240

merged 6 commits into from
Mar 31, 2021

Conversation

Vyvy-vi
Copy link
Owner

@Vyvy-vi Vyvy-vi commented Mar 31, 2021

Description

Adds a logger to the bot, that logs debug logs to a .log file and the rest to stdout

Related Issue:

related to #234

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • I have read the contributing guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings

@Vyvy-vi Vyvy-vi changed the base branch from main to chore/best-practices March 31, 2021 22:24
@github-actions github-actions bot added awaiting review enhancement New feature or request labels Mar 31, 2021
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 31, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.01%.

Quality metrics Before After Change
Complexity 3.03 ⭐ 2.94 ⭐ -0.09 👍
Method Length 50.28 ⭐ 51.35 ⭐ 1.07 👎
Working memory 11.19 😞 11.16 😞 -0.03 👍
Quality 66.30% 🙂 66.31% 🙂 0.01% 👍
Other metrics Before After Change
Lines 631 653 22
Changed files Quality Before Quality After Quality Change
bot/main.py 78.35% ⭐ 71.77% 🙂 -6.58% 👎
bot/cogs/coffee.py 81.28% ⭐ 81.28% ⭐ 0.00%
bot/cogs/economy.py 64.78% 🙂 64.69% 🙂 -0.09% 👎
bot/cogs/events.py 69.43% 🙂 69.24% 🙂 -0.19% 👎
bot/cogs/game.py 72.24% 🙂 72.24% 🙂 0.00%
bot/cogs/help.py 61.68% 🙂 61.68% 🙂 0.00%
bot/cogs/ping.py 82.64% ⭐ 82.64% ⭐ 0.00%
bot/cogs/utilities.py 56.43% 🙂 57.69% 🙂 1.26% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
bot/cogs/utilities.py Utils.weather 5 ⭐ 252 ⛔ 20 ⛔ 37.93% 😞 Try splitting into smaller methods. Extract out complex expressions
bot/cogs/help.py Help.help 9 🙂 167 😞 16 ⛔ 43.43% 😞 Try splitting into smaller methods. Extract out complex expressions
bot/cogs/utilities.py Utils.wiki 6 ⭐ 171 😞 17 ⛔ 44.92% 😞 Try splitting into smaller methods. Extract out complex expressions
bot/cogs/economy.py Economy.cry 6 ⭐ 154 😞 13 😞 51.37% 🙂 Try splitting into smaller methods. Extract out complex expressions
bot/cogs/economy.py level_up 3 ⭐ 136 😞 14 😞 54.86% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@Vyvy-vi Vyvy-vi merged commit 4b2dd87 into chore/best-practices Mar 31, 2021
@Vyvy-vi Vyvy-vi deleted the feat/logging branch March 31, 2021 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant