]> err.no Git - dak/commitdiff
process-upload: Change logging behaviour for --no-action
authorFrank Lichtenheld <djpig@debian.org>
Fri, 30 Oct 2009 11:42:34 +0000 (11:42 +0000)
committerFrank Lichtenheld <djpig@debian.org>
Fri, 30 Oct 2009 11:42:34 +0000 (11:42 +0000)
Log to stderr instead if not at all.

Signed-off-by: Frank Lichtenheld <djpig@debian.org>
dak/process_upload.py

index b37fbaeefbf7bc8951211666de618ca247f8a1c8..24d297c33865c5e444c345178e811a3af01425db 100755 (executable)
@@ -228,12 +228,13 @@ def main():
                 utils.fubar("Couldn't obtain lock; assuming another 'dak process-upload' is already running.")
             else:
                 raise
-        Logger = daklog.Logger(cnf, "process-upload")
         if cnf.get("Dir::UrgencyLog"):
             # Initialise UrgencyLog()
             log_urgency = True
             UrgencyLog()
 
+    Logger = daklog.Logger(cnf, "process-upload", Options["No-Action"])
+
     # Sort the .changes files so that we process sourceful ones first
     changes_files.sort(utils.changes_compare)
 
@@ -252,9 +253,9 @@ def main():
         Logger.log(["total", summarystats.accept_count, summarystats.accept_bytes])
 
     if not Options["No-Action"]:
-        Logger.close()
         if log_urgency:
             UrgencyLog().close()
+    Logger.close()
 
 ###############################################################################