From 4326c67b1a29a8554bc3904d708bf27fd7722d4b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Oct 2019 12:27:43 +0100 Subject: [PATCH] Only save a post log in debug mode --- posts.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/posts.py b/posts.py index 746033f47..afb8906ee 100644 --- a/posts.py +++ b/posts.py @@ -1026,10 +1026,11 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\ # Don't accumulate massive files on systems with limited resources while len(postLog)>16: postLog.pop(0) - # save the log file - postLogFilename=baseDir+'/post.log' - with open(postLogFilename, "a+") as logFile: - logFile.write(logStr+'\n') + if debug: + # save the log file + postLogFilename=baseDir+'/post.log' + with open(postLogFilename, "a+") as logFile: + logFile.write(logStr+'\n') if postResult: if debug: