File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -133,13 +133,14 @@ using a method call:
133
133
134
134
.. code :: python
135
135
136
+ import logging
136
137
import time
137
138
from http_request_randomizer.requests.proxy.requestProxy import RequestProxy
138
139
139
140
if __name__ == ' __main__' :
140
141
141
142
start = time.time()
142
- req_proxy = RequestProxy()
143
+ req_proxy = RequestProxy(log_level = logging. ERROR )
143
144
print (" Initialization took: {0} sec" .format((time.time() - start)))
144
145
print (" Size: {0} " .format(len (req_proxy.get_proxy_list())))
145
146
print (" ALL = {0} " .format(list (map (lambda x : x.get_address(), req_proxy.get_proxy_list()))))
@@ -157,6 +158,17 @@ using a method call:
157
158
print (" -> Going to sleep.." )
158
159
time.sleep(10 )
159
160
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
+
160
172
Documentation
161
173
-------------
162
174
You can’t perform that action at this time.
0 commit comments