Skip to content

Conversation

@broglea
Copy link
Contributor

@broglea broglea commented Nov 15, 2020

There is no current way to stop this from logging to the console with the way this was hard coded to log everything. You can't override the logging level of this module from a calling module because this overrides it whenever you instantiate a new instance of the class and things are logged during the __init__ of the object.

This allows the person using this library to pass in an optional log level.

Copy link
Owner

@pgaref pgaref left a comment

Choose a reason for hiding this comment

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

Hey @broglea thanks for the PR -- pretty useful change indeed!

Could you also add some kind of documentation for future reference?
RequestProxy init would be one place to doc the parameters, and the API example could show how to use it. https://github.com/pgaref/HTTP_Request_Randomizer#api

Btw, this could also be a super useful option as part of the command line interface -- but could, of course, be a follow-up. https://github.com/pgaref/HTTP_Request_Randomizer#command-line-interface

@broglea
Copy link
Contributor Author

broglea commented Nov 15, 2020

@pgaref I added documentation of this to my branch. Should I also bump the version here in this PR so a new release can be cut with this change?

@broglea
Copy link
Contributor Author

broglea commented Nov 15, 2020

I am actually unsure how to properly bump version as in __init__.py it is 1.2.3 but latest release is 1.3.1

@pgaref
Copy link
Owner

pgaref commented Nov 15, 2020

I am actually unsure how to properly bump version as in __init__.py it is 1.2.3 but latest release is 1.3.1

Lets bump that to 1.3.2 and I can take care of the release.

Just make sure python -c 'import http_request_randomizer; print(http_request_randomizer.__version__)' prints the correct version

Copy link
Owner

@pgaref pgaref left a comment

Choose a reason for hiding this comment

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

@broglea
Copy link
Contributor Author

broglea commented Nov 15, 2020

@pgaref done and done

Copy link
Owner

@pgaref pgaref left a comment

Choose a reason for hiding this comment

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

LGTM

@pgaref pgaref changed the title Allowing log_level to be set during instantiation of RequestProxy Allowing log_level to be set during instantiation of RequestProxy (#68) Nov 15, 2020
@pgaref pgaref merged commit 26d8cb7 into pgaref:master Nov 15, 2020
@pgaref
Copy link
Owner

pgaref commented Nov 15, 2020

Merged to master, @broglea thanks again for the PR!

I am going to release this as 1.3.2 asap

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