From 448ffb48d8c9b1cc52f28abb6bc46277c5077ba1 Mon Sep 17 00:00:00 2001 From: liviu- Date: Sun, 18 Sep 2016 13:53:10 +0100 Subject: [PATCH] Add basic logging (#5) --- crosslinking_bot/crosslinking_bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crosslinking_bot/crosslinking_bot.py b/crosslinking_bot/crosslinking_bot.py index da08341..63ad1c2 100755 --- a/crosslinking_bot/crosslinking_bot.py +++ b/crosslinking_bot/crosslinking_bot.py @@ -10,6 +10,7 @@ import re import time import collections +import logging from datetime import datetime import praw @@ -30,6 +31,7 @@ # Minimum number of comments of an HN story to be considered COMM_NUM_THRESHOLD = 3 +logging.basicConfig(filename='.log',level=logging.DEBUG) def get_reddit_submissions(): """Download top `REDDIT_LIMIT` submissions from the /r/machinelearning subreddit. @@ -125,6 +127,7 @@ def post_comments(common_subs): if not any(comm for comm in reddit_obj.comments if CONFIG['user'] in str(comm.author)): comment = prepare_comment(hn_hits) reddit_obj.add_comment(comment) + logging.info(comment) time.sleep(SLEEP_TIME) def run_bot():