Improve logging
This commit is contained in:
		| @@ -33,10 +33,10 @@ def feed(): | ||||
|     except KeyboardInterrupt: | ||||
|         raise | ||||
|     except PRAWException as e: | ||||
|         logging.error('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         logging.critical('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         return [] | ||||
|     except PrawcoreException as e: | ||||
|         logging.error('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         logging.critical('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         return [] | ||||
|  | ||||
| def comment(i): | ||||
| @@ -84,10 +84,10 @@ def story(ref): | ||||
|     except KeyboardInterrupt: | ||||
|         raise | ||||
|     except PRAWException as e: | ||||
|         logging.error('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         logging.critical('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         return False | ||||
|     except PrawcoreException as e: | ||||
|         logging.error('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         logging.critical('Problem hitting reddit API: {}'.format(str(e))) | ||||
|         return False | ||||
|  | ||||
| # scratchpad so I can quickly develop the parser | ||||
|   | ||||
| @@ -34,7 +34,7 @@ def api(route): | ||||
|     except KeyboardInterrupt: | ||||
|         raise | ||||
|     except BaseException as e: | ||||
|         logging.error('Problem hitting tildes website: {}'.format(str(e))) | ||||
|         logging.critical('Problem hitting tildes website: {}'.format(str(e))) | ||||
|         return False | ||||
|  | ||||
| def feed(): | ||||
| @@ -113,7 +113,7 @@ def story(ref): | ||||
|  | ||||
| # scratchpad so I can quickly develop the parser | ||||
| if __name__ == '__main__': | ||||
|     #print(feed()) | ||||
|     print(feed()) | ||||
|     #normal = story('gxt') | ||||
|     #print(normal) | ||||
|     #no_comments = story('gxr') | ||||
| @@ -122,8 +122,8 @@ if __name__ == '__main__': | ||||
|     #print(self_post) | ||||
|     #li_comment = story('gqx') | ||||
|     #print(li_comment) | ||||
|     broken = story('q4y') | ||||
|     print(broken) | ||||
|     #broken = story('q4y') | ||||
|     #print(broken) | ||||
|  | ||||
|     # make sure there's no self-reference | ||||
|     #import copy | ||||
|   | ||||
		Reference in New Issue
	
	Block a user