[CRIU] [PATCH 2/4] p.haul: log few blank lines before each run
Nikita Spiridonov
nspiridonov at virtuozzo.com
Thu Apr 21 05:46:30 PDT 2016
Since phaul and phaul-service don't overwrite logs anymore,
log few blank lines before each run to make logs more readable.
Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
p.haul | 2 ++
p.haul-service | 2 ++
phaul/util.py | 6 ++++++
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/p.haul b/p.haul
index 98560f6..8a36d90 100755
--- a/p.haul
+++ b/p.haul
@@ -3,6 +3,7 @@
import sys
import logging
import phaul.args_parser
+import phaul.util
import phaul.iters
import phaul.connection
@@ -36,6 +37,7 @@ logging.basicConfig(filename=args.log_file, filemode="a", level=logging.INFO,
# Setup hook to log uncaught exceptions
sys.excepthook = log_uncaught_exception
+phaul.util.log_header()
logging.info("Starting p.haul")
# Establish connection
diff --git a/p.haul-service b/p.haul-service
index b3cbc1c..6fe33ea 100755
--- a/p.haul-service
+++ b/p.haul-service
@@ -4,6 +4,7 @@ import sys
import signal
import logging
import phaul.args_parser
+import phaul.util
import phaul.xem_rpc
import phaul.service
import phaul.connection
@@ -30,6 +31,7 @@ logging.basicConfig(filename=args.log_file, filemode="a", level=logging.INFO,
# Setup hook to log uncaught exceptions
sys.excepthook = log_uncaught_exception
+phaul.util.log_header()
logging.info("Starting p.haul service")
# Establish connection
diff --git a/phaul/util.py b/phaul/util.py
index 2482570..9cca073 100644
--- a/phaul/util.py
+++ b/phaul/util.py
@@ -78,3 +78,9 @@ def makedirs(dirpath):
pass
else:
raise
+
+
+def log_header():
+ OFFSET_LINES_COUNT = 3
+ for i in range(OFFSET_LINES_COUNT):
+ logging.info("")
--
1.7.1
More information about the CRIU
mailing list