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

First stab at explainability #344

Closed
wants to merge 5 commits into from
Closed

First stab at explainability #344

wants to merge 5 commits into from

Conversation

gleitz
Copy link
Owner

@gleitz gleitz commented Feb 26, 2021

Should make debugging issues much easier to discover. Any additional info that could be included?

» python -m howdoi.howdoi set log level python -x -C -n3
Cache cleared successfully
INFO: Fetching answers for query: set log level python
INFO: stackoverflow.com links found on google: 10
INFO: Answers requested: 3 starting at position: 1
INFO: Fetching page: https://stackoverflow.com/questions/38537905/set-logging-levels
INFO: Code snippet found
INFO: Fetching page: https://stackoverflow.com/questions/48787538/how-to-set-logging-level-for-the-module-only-in-python
INFO: Code snippet found
INFO: Fetching page: https://stackoverflow.com/questions/54036637/python-how-to-set-logging-level-for-all-loggers-to-info
INFO: Code snippet found
INFO: Total answers returned: 3
★  Answer from https://stackoverflow.com/questions/38537905/set-logging-levels ★
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger('foo').debug('bah')
logging.getLogger().setLevel(logging.INFO)
logging.getLogger('foo').debug('bah')

================================================================================

★  Answer from https://stackoverflow.com/questions/48787538/how-to-set-logging-level-for-the-module-only-in-python ★
import logging

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

def function_that_logs():
    logger.info('will log')   # note, using logger not logging
    logger.debug('will not log')

================================================================================

★  Answer from https://stackoverflow.com/questions/54036637/python-how-to-set-logging-level-for-all-loggers-to-info ★
loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
for logger in loggers:
    logger.setLevel(logging.INFO)

@gleitz
Copy link
Owner Author

gleitz commented Feb 26, 2021

Addresses #330 and #334

@gleitz gleitz mentioned this pull request Mar 5, 2021
KimaruThagna pushed a commit to MLH-Fellowship/howdoi that referenced this pull request Mar 31, 2021
gleitz pushed a commit that referenced this pull request Apr 14, 2021
# This is the 1st commit message:

move from print_err to logging

# This is the commit message #2:

change sanity check message

# This is the commit message #3:

flake8 linting

# This is the commit message #4:

flake8 linting

# This is the commit message #5:

pylint updates

# This is the commit message #6:

pylint updates

# This is the commit message #7:

pylint updates for errors.py

# This is the commit message #8:

update changes from #344

# This is the commit message #9:

update formatting

# This is the commit message #10:

update formatting

# This is the commit message #11:

add consuructor to class

# This is the commit message #12:

refactor logging levels and messages

# This is the commit message #13:

refactor logging levels and messages

# This is the commit message #14:

pylint recomendations

# This is the commit message #15:

flake8 formating

# This is the commit message #16:

flake8 formating

# This is the commit message #17:

change logging to print
@gleitz
Copy link
Owner Author

gleitz commented Apr 14, 2021

Closed in favor of #381

@gleitz gleitz closed this Apr 14, 2021
@gleitz gleitz deleted the explainability branch April 14, 2021 15:49
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

1 participant