Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/77703


Change subject: Log all actions of github-to-gerrit in one place
......................................................................

Log all actions of github-to-gerrit in one place

Previously having them all separate made sense, since they were
launched as separate jobs. Since that isn't the case now, we
can have one central file for them all.

Also fixed some really, really stupid errors in the code

Change-Id: Id9da02c4a06e4edbfc9a0d63bef68208a41b3e0b
---
M src/github-to-gerrit.py
1 file changed, 4 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/SuchABot 
refs/changes/03/77703/1

diff --git a/src/github-to-gerrit.py b/src/github-to-gerrit.py
index f439cae..a22383b 100644
--- a/src/github-to-gerrit.py
+++ b/src/github-to-gerrit.py
@@ -99,6 +99,7 @@
 
 
 def do_review(pr):
+    logging.setFormatter(logging.Formatter("%%(asctime)%s %s PR#%s 
%%(message)s" % (pr.base.repo.name, pr.number))
     name = gerrit_name_for(pr.base.repo.name)
     ensure_repo(name)
     gh_name = pr.base.repo.name
@@ -151,19 +152,16 @@
         logging.info('Left comment on Pull Request')
 
 if __name__ == '__main__':
-    name = sys.argv[1]
-    pr_num = sys.argv[2]
-
     logging.basicConfig(
-            format='%%(asctime)s %s PR#%s %%(message)s' % (name, pr_num),
-            filename=os.path.expanduser('~/logs/%s.process' % name),
+            format='%(asctime)s %(message)',
+            filename=os.path.expanduser('~/logs/github-to-gerrit'),
             level=logging.INFO
     )
-
     logging.info('Attempting to Redis connection to %s', REDIS_HOST)
     red = redis.StrictRedis(host=REDIS_HOST, db=REDIS_DB)
     logging.info('Redis connection to %s succeded', REDIS_HOST)
 
+
     try:
         while True:
             data = json.loads(red.brpop(QUEUE_KEY)[1])

-- 
To view, visit https://gerrit.wikimedia.org/r/77703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9da02c4a06e4edbfc9a0d63bef68208a41b3e0b
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/SuchABot
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to