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

Library interferes with application logging configuration #23

Open
dsoprea opened this issue Nov 19, 2020 · 10 comments
Open

Library interferes with application logging configuration #23

dsoprea opened this issue Nov 19, 2020 · 10 comments
Milestone

Comments

@dsoprea
Copy link

dsoprea commented Nov 19, 2020

Because of this:

https://github.com/mediacloud/ultimate-sitemap-parser/blob/68d1ccdd573be16cdfadc7f071c088642182bff1/usp/fetch_parse.py#L43

and this:

https://github.com/mediacloud/ultimate-sitemap-parser/blob/68d1ccdd573be16cdfadc7f071c088642182bff1/usp/log.py#L36-L43

this library almost always ends-up configuring the logging of the calling application in ways not often desired. It's usually not appropriate to unconditionally print logging to the screen. Can you please remove the code (shown above) where it's adding handlers if no handlers already exists?

Also, this module is overriding all of the built-in logging functionality unnecessarily. It could just use the logging object directly (e.g. _LOGGING = logging.getLogger(__name__)), but that's just a side comment.

I'm currently having to do this to squash your output:

import usp.fetch_parse
import usp.objects.sitemap

logging.getLogger('usp.fetch_parse').handlers = []
logging.getLogger('usp.helpers').handlers = []
@pypt
Copy link
Contributor

pypt commented Nov 20, 2020 via email

@dsoprea
Copy link
Author

dsoprea commented Nov 20, 2020

Sure. I just wanted to see if you'd respond, first.

#24

@dsoprea
Copy link
Author

dsoprea commented Nov 22, 2020

Bump

1 similar comment
@dsoprea
Copy link
Author

dsoprea commented Nov 23, 2020

Bump

@pypt
Copy link
Contributor

pypt commented Nov 23, 2020 via email

@dsoprea
Copy link
Author

dsoprea commented Nov 23, 2020

I was busy too, yet I made time for an extremely simple PR.

@dsoprea
Copy link
Author

dsoprea commented Nov 27, 2020

Bump.

2 similar comments
@dsoprea
Copy link
Author

dsoprea commented Nov 28, 2020

Bump.

@dsoprea
Copy link
Author

dsoprea commented Nov 29, 2020

Bump.

@Pikamander2
Copy link

Hey @pypt - We need this change in our app too. Do you have a rough idea of when the change will be added?

@freddyheppell freddyheppell added this to the 0.6 milestone Sep 4, 2024
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 a pull request may close this issue.

4 participants