Skip to content

Commit

Permalink
Add basic logging (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
liviu- committed Sep 18, 2016
1 parent e42ff61 commit 448ffb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crosslinking_bot/crosslinking_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import re
import time
import collections
import logging
from datetime import datetime

import praw
Expand All @@ -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.
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 448ffb4

Please sign in to comment.