From: jfa Date: Thu, 26 May 2022 11:35:23 +0000 (+0300) Subject: [bos #29467] [EDF] (2022-T1) Logging of SALOME usage: specific log in SALOME X-Git-Tag: emc2p_1.4.0-rc1~6^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19cfd676a9210d9ec261d27e2b918edbf24bf4f0;p=modules%2Fkernel.git [bos #29467] [EDF] (2022-T1) Logging of SALOME usage: specific log in SALOME --- diff --git a/bin/appliskel/.salome-completion.sh b/bin/appliskel/.salome-completion.sh index 000e18cf9..48ad2df01 100755 --- a/bin/appliskel/.salome-completion.sh +++ b/bin/appliskel/.salome-completion.sh @@ -71,7 +71,7 @@ _salome() if [[ "$cur" == -* ]]; then case $command in start) - options='-t --terminal -g --gui -d --show-desktop= -o --hide-desktop -b --batch -l --logger -f --log-file= -r --resources= -x --xterm -m --modules= -e --embedded= -s --standalone= -p --portkill -k --killall -i --interp= -z --splash= -c --catch-exceptions= --print-port --nosave-config --pinter --ns-port-log= --test= --play= --gdb-session --ddd-session --valgrind-session -w --shutdown-servers= --foreground= --wake-up-session --server-launch-mode= --port= --version -h --help --with-mpi-module= --config=' + options='-t --terminal -g --gui -d --show-desktop= -o --hide-desktop -b --batch -l --logger -f --log-file= --gui-log-file= -r --resources= -x --xterm -m --modules= -e --embedded= -s --standalone= -p --portkill -k --killall -i --interp= -z --splash= -c --catch-exceptions= --print-port --nosave-config --pinter --ns-port-log= --test= --play= --gdb-session --ddd-session --valgrind-session -w --shutdown-servers= --foreground= --wake-up-session --server-launch-mode= --port= --version -h --help --with-mpi-module= --config=' ;; shell) options='-h --help -p --port= -m --machine= -d --directory= -u --user= --with-mpi-module= --config=' diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 3609afa8c..26b0913c0 100644 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -585,6 +585,13 @@ Python file arguments, if any, must be comma-separated (without blank characters dest="log_file", help=help_str) + # Use gui-log-file for specific user actions in GUI. Default: nothing. + help_str = "Log specific user actions in GUI to " + pars.add_argument("--gui-log-file", + metavar="", + dest="gui_log_file", + help=help_str) + # Configuration XML file. Default: see defaultUserFile() function help_str = "Parse application settings from the " help_str += "instead of default %s" % defaultUserFile() @@ -1009,6 +1016,7 @@ def get_env(appname=salomeappname, cfgname=salomecfgname, exeName=None, keepEnvi args["session_gui"] = False args[batch_nam] = False args["study_hdf"] = None + args["gui_log_file"] = None if cmd_opts.gui is not None: args[gui_nam] = cmd_opts.gui if cmd_opts.batch is not None: @@ -1036,6 +1044,10 @@ def get_env(appname=salomeappname, cfgname=salomecfgname, exeName=None, keepEnvi else: args[file_nam] = [cmd_opts.log_file] + # GUI Log file + if cmd_opts.gui_log_file is not None: + args["gui_log_file"] = cmd_opts.gui_log_file + # Naming Service port log file if cmd_opts.ns_port_log_file is not None: args["ns_port_log_file"] = cmd_opts.ns_port_log_file diff --git a/bin/runSalomeCommon.py b/bin/runSalomeCommon.py index 9a4d68629..7f3a05e0e 100755 --- a/bin/runSalomeCommon.py +++ b/bin/runSalomeCommon.py @@ -331,6 +331,10 @@ class CommonSessionServer(Server): self.SCMD2+=['--pyscript=%s'%(msg)] pass pass + if self.args['gui_log_file'] is not None: + self.SCMD2+=['--gui-log-file=%s'%self.args['gui_log_file']] + pass + pass pass if self.args['noexcepthandler']: self.SCMD2+=['--no-exception-handler']