From fd48f12baccdba974b2e405b77b67fbd07b6b383 Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Mon, 25 Jul 2016 11:39:36 +0200 Subject: [PATCH] add a header to the log command --- commands/log.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commands/log.py b/commands/log.py index 6b92609..12a87ee 100644 --- a/commands/log.py +++ b/commands/log.py @@ -19,6 +19,7 @@ import os import shutil import re +import glob # Compatibility python 2/3 for input function # input stays input for python 3 and input = raw_input for python 2 @@ -139,7 +140,13 @@ def run(args, runner, logger): # get the log directory. logDir = runner.cfg.SITE.log.log_dir - + + # Print a header + nb_files_log_dir = len(glob.glob(os.path.join(logDir, "*"))) + info = [("log directory", logDir), + ("number of log files", nb_files_log_dir)] + src.print_info(logger, info) + # If the clean options is invoked, # do nothing but deleting the concerned files. if options.clean: -- 2.39.2