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

Update logging messages(#282) #303

Merged
merged 1 commit into from
Oct 27, 2017
Merged

Conversation

FabioRosado
Copy link
Member

Description

Added some logging separation throughout the code, replaced concatenation with string formatting using %s as discussed in gitter.
Please let me know if things are okay or if I should change something around.

Fixes: #282

Status

READY | UNDER DEVELOPMENT | ON HOLD

Type of change

Please delete options that are not relevant.

  • 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)
  • This change requires a documentation update
  • Documentation (fix or adds documentation)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested locally using unit tests
  • Tested using Travis on own fork

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@coveralls
Copy link

coveralls commented Oct 24, 2017

Coverage Status

Coverage decreased (-0.02%) to 96.755% when pulling 43f64f1 on FabioRosado:logging into d425e0e on opsdroid:master.

@jacobtomlinson
Copy link
Member

Nice one! I'm guessing the decrease in coverage is related to adding extra logging in an uncovered area, so that's fine.

I'll take a look through later just to be sure I agree with the levels.

@FabioRosado
Copy link
Member Author

I added a logging.error message in the welcome message but it seems that the ones not being logged are in loader (even though previous builds show that this one wasn't tested?) Let me know if this is the issue.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are great. Only one level I disagree with here.

@@ -104,7 +104,8 @@ def welcome_message(config):
"releases")
_LOGGER.info("=" * 40)
except KeyError:
pass
_LOGGER.error("'welcome-message: true/false' is missing in "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a warning as it still works without it.

@coveralls
Copy link

coveralls commented Oct 27, 2017

Coverage Status

Coverage decreased (-0.02%) to 96.755% when pulling a3ee7eb on FabioRosado:logging into 1bae1a6 on opsdroid:master.

@coveralls
Copy link

coveralls commented Oct 27, 2017

Coverage Status

Coverage decreased (-0.02%) to 96.755% when pulling 13b8877 on FabioRosado:logging into 1bae1a6 on opsdroid:master.

@FabioRosado
Copy link
Member Author

I've made a test to try and bump the coverage up again but it kept failing.

What I tried:

  • Use the test_loader.test_load_modules
  • Mock the logging.error
  • set module = None
  • call loader._load_modules(modules_type, modules)

The else statement doesn't run because of the for loop on line 223 of opsdroid.loader causes the test to get a TypeError: 'NoneType' object is not iterable

Will this cause an issue in the future and should we change the _load_modules function if into a try?

@jacobtomlinson
Copy link
Member

Yeah don't worry for now. I'm happy to merge it even with the slight drop. Perhaps investigate this further in a separate issue.

@jacobtomlinson jacobtomlinson merged commit 31dffc2 into opsdroid:master Oct 27, 2017
@FabioRosado FabioRosado deleted the logging branch October 27, 2017 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants