From: Serge Rehbinder Date: Fri, 23 Sep 2016 13:48:42 +0000 (+0200) Subject: do not show micro commands (commands called by another one) in the hat log file X-Git-Tag: 5.0.0a1~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0724a2111eabbc146f775e3c755cc2ec5777954;p=tools%2Fsat.git do not show micro commands (commands called by another one) in the hat log file --- diff --git a/salomeTools.py b/salomeTools.py index 0744fff..34ee85c 100755 --- a/salomeTools.py +++ b/salomeTools.py @@ -213,9 +213,13 @@ class Sat(object): silent = (self.cfg.USER.output_verbose_level == 0) # create log file + micro_command = False + if logger_add_link: + micro_command = True logger_command = src.logger.Logger(self.cfg, silent_sysstd=silent, - all_in_terminal=self.options.all_in_terminal) + all_in_terminal=self.options.all_in_terminal, + micro_command=micro_command) # Check that the path given by the logs_paths_in_file option # is a file path that can be written diff --git a/src/logger.py b/src/logger.py index 297cba0..419b878 100644 --- a/src/logger.py +++ b/src/logger.py @@ -32,7 +32,11 @@ logCommandFileExpression = "^[0-9]{8}_+[0-9]{6}_+.*\.xml$" class Logger(object): '''Class to handle log mechanism. ''' - def __init__(self, config, silent_sysstd=False, all_in_terminal=False): + def __init__(self, + config, + silent_sysstd=False, + all_in_terminal=False, + micro_command = False): '''Initialization :param config pyconf.Config: The global configuration. @@ -44,11 +48,15 @@ class Logger(object): self.silentSysStd = silent_sysstd # Construct xml log file location for sat prints. - logFileName = config.VARS.datehour + "_" + config.VARS.command + ".xml" + prefix = "" + if micro_command: + prefix = "micro_" + hour_command = config.VARS.datehour + "_" + config.VARS.command + logFileName = prefix + hour_command + ".xml" logFilePath = os.path.join(config.USER.log_dir, logFileName) # Construct txt file location in order to log # the external commands calls (cmake, make, git clone, etc...) - txtFileName = config.VARS.datehour + "_" + config.VARS.command + ".txt" + txtFileName = prefix + hour_command + ".txt" txtFilePath = os.path.join(config.USER.log_dir, "OUT", txtFileName) src.ensure_path_exists(os.path.dirname(logFilePath))