]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
do not show micro commands (commands called by another one) in the hat log file
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Fri, 23 Sep 2016 13:48:42 +0000 (15:48 +0200)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Fri, 23 Sep 2016 13:48:42 +0000 (15:48 +0200)
salomeTools.py
src/logger.py

index 0744fff8bd2cc822830832cc0c4bb50c581f78cd..34ee85c9a761df5e93f1cc3440165abb7a356b19 100755 (executable)
@@ -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
index 297cba019ab41cafcc0c6addadc5e43c3877869c..419b878642ab5215bd87aa3b7f313055d974bd80 100644 (file)
@@ -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))