commit e977c9e07f177e8bc2b51265de1bc93475397f61
parent 2b573a81095ac0b57379389336a469a671ec10d7
Author: parazyd <parazyd@dyne.org>
Date:   Wed,  8 Nov 2017 16:58:28 +0100
tidier stdout for logging
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/amprolla_merge.py b/amprolla_merge.py
@@ -117,7 +117,7 @@ def gen_release(suite):
     """
 
     filelist = []
-    print('Crawling %s' % suite)
+    print('\nCrawling %s' % suite)
     rootdir = join(mergedir, mergesubdir, suite)
     for cat in categories:
         for arch in arches:
diff --git a/lib/log.py b/lib/log.py
@@ -5,7 +5,7 @@ Logging functions
 """
 
 from time import time
-from os import makedirs, remove
+from os import makedirs
 from os.path import join
 import sys
 
@@ -16,10 +16,10 @@ def die(msg, tofile=True):
     """
     Log error and exit with exitcode 1
     """
-    msg = "%d [ERR] %s\n" % (int(time()), msg)
+    msg = "%d [ERR] %s" % (int(time()), msg)
     print(msg)
     if tofile:
-        logtofile('amprolla.txt', msg)
+        logtofile('amprolla.txt', msg+'\n')
     sys.exit(1)
 
 
@@ -27,20 +27,20 @@ def warn(msg, tofile=True):
     """
     Log warning and continue
     """
-    msg = "%d [WARN] %s\n" % (int(time()), msg)
+    msg = "%d [WARN] %s" % (int(time()), msg)
     print(msg)
     if tofile:
-        logtofile('amprolla.txt', msg)
+        logtofile('amprolla.txt', msg+'\n')
 
 
 def info(msg, tofile=True):
     """
     Log informational message and continue
     """
-    msg = "%d [INFO] %s\n" % (int(time()), msg)
+    msg = "%d [INFO] %s" % (int(time()), msg)
     print(msg)
     if tofile:
-        logtofile('amprolla.txt', msg)
+        logtofile('amprolla.txt', msg+'\n')
 
 
 def logtofile(filename, text, redo=False):