Skip to content

Commit a2bda0e

Browse files
author
Panos Garefalakis
committed
Getting ready for 1.3.2 release
1 parent 26d8cb7 commit a2bda0e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,14 @@ using a method call:
133133

134134
.. code:: python
135135
136+
import logging
136137
import time
137138
from http_request_randomizer.requests.proxy.requestProxy import RequestProxy
138139
139140
if __name__ == '__main__':
140141
141142
start = time.time()
142-
req_proxy = RequestProxy()
143+
req_proxy = RequestProxy(log_level=logging.ERROR)
143144
print("Initialization took: {0} sec".format((time.time() - start)))
144145
print("Size: {0}".format(len(req_proxy.get_proxy_list())))
145146
print("ALL = {0} ".format(list(map(lambda x: x.get_address(), req_proxy.get_proxy_list()))))
@@ -157,6 +158,17 @@ using a method call:
157158
print("-> Going to sleep..")
158159
time.sleep(10)
159160
161+
Changing log levels
162+
~~~~~~~~~~~~~~~~~~~
163+
164+
The ``RequestProxy`` constructor accepts an optional parameter of
165+
``log_level`` that can be used to change the level of logging. By
166+
default, this is equal to 0, or NOTSET. The python logging levels are
167+
documented
168+
`here <https://docs.python.org/3/library/logging.html#logging-levels>`__.
169+
You can either use integers or their equivalent constant in the logging
170+
module. (e.g. ``logging.DEBUG``, ``logging.ERROR``, etc)
171+
160172
Documentation
161173
-------------
162174

0 commit comments

Comments
 (0)