@@ -40,13 +40,13 @@ def get_html(url, args, flag_get_new_link):
4040 else :
4141 html = response .read ()
4242 except urllib2 .URLError as e :
43- logging .error ("{0} URLError: {1}" .format (url .encode ("utf8" ), e .reason ))
43+ logging .warning ("{0} URLError: {1}" .format (url .encode ("utf8" ), e .reason ))
4444 except urllib2 .HTTPError as e :
45- logging .error ("{0} HTTPError: {1}" .format (url .encode ("utf8" ), e .code ))
45+ logging .warning ("{0} HTTPError: {1}" .format (url .encode ("utf8" ), e .code ))
4646 except Exception as e :
47- logging .error ("{0} Unexpected: {1}" .format (url .encode ("utf8" ), str (e )))
47+ logging .warning ("{0} Unexpected: {1}" .format (url .encode ("utf8" ), str (e )))
4848 else :
49- logging .debug ("{0} downloaded {1}" .format (thread_name , url .encode ("utf8" )))
49+ logging .info ("{0} downloaded {1}" .format (thread_name , url .encode ("utf8" )))
5050
5151 if args .key == "" :
5252 if flag_get_new_link :
@@ -59,10 +59,10 @@ def get_html(url, args, flag_get_new_link):
5959
6060 match = re .search (re .compile (args .key ), html .decode (args .encoding , "ignore" ))
6161 if match and flag_get_new_link :
62- logging .debug ("{0} {1} match key" .format (thread_name , url .encode ("utf8" )))
62+ logging .info ("{0} {1} match key" .format (thread_name , url .encode ("utf8" )))
6363 new_link = get_link (html )
6464 else :
65- logging .debug ("{0} {1} not match key" .format (thread_name , url .encode ("utf8" )))
65+ logging .info ("{0} {1} not match key" .format (thread_name , url .encode ("utf8" )))
6666 finally :
6767 return html , new_link
6868
0 commit comments