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:
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+
160172Documentation
161173-------------
162174
You can’t perform that action at this time.
0 commit comments