From d37edc888453a6b19c5c5567796e142e0384654b Mon Sep 17 00:00:00 2001 From: Nik Nyby Date: Tue, 14 Nov 2017 14:59:33 -0500 Subject: [PATCH] Print out log message to stdout This is just an idea. In my setup, the log file isn't created for whatever reason. I thought this could just be helpful. --- bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index f9fcd07..50e422a 100644 --- a/bot.py +++ b/bot.py @@ -56,6 +56,7 @@ def tweet(text): def log(message): """Log message to logfile.""" + print('log: {}'.format(message)) path = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) with open(os.path.join(path, logfile_name), 'a+') as f: t = strftime("%d %b %Y %H:%M:%S", gmtime()) @@ -64,4 +65,4 @@ def log(message): if __name__ == "__main__": tweet_text = create_tweet() - tweet(tweet_text) \ No newline at end of file + tweet(tweet_text)