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

chore: add logger #525

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from
Open

chore: add logger #525

wants to merge 2 commits into from

Conversation

chloelbn
Copy link

@chloelbn chloelbn commented May 4, 2021

Q A
Bug fix? no
New feature? no
BC breaks? no
Related issue #429

Describe your change

Adds a logger to give more info about requests and responses

@chloelbn chloelbn requested review from tkrugg and DevinCodes May 4, 2021 15:37
Copy link
Contributor

@DevinCodes DevinCodes left a comment

Choose a reason for hiding this comment

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

I hope I understood the changes, I'm not familiar with Python so not all comments may be relevant 🙂

self._logger = logging.getLogger('algolia')
self._logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
fh = logging.FileHandler('debug.log')
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this configurable, please? We can still default to debug.log 🙂

Comment on lines +40 to +43
self._logger.addHandler(fh)
self._logger.addHandler(ch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to run both? Or do we want the user to configure which one to use?

@chloelbn chloelbn changed the title Chore/add logger chore: add logger May 4, 2021
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.

2 participants