Salome HOME
logStructuredUserEvent: New routine.
authorPascal Obry <pascal.obry@edf.fr>
Fri, 12 May 2023 07:28:51 +0000 (09:28 +0200)
committerPascal Obry <pascal.obry@edf.fr>
Tue, 5 Sep 2023 09:36:26 +0000 (11:36 +0200)
Equivalent to logUserEvent but with multiple parameters that must
be logged. This is to ensure consistent message formatting. All
parts are separated with a single coma.

src/CAM/CAM_Application.cxx
src/CAM/CAM_Application.h

index edcc4968eae071cbbd14e71c3803d8503fe5180a..5dd76fe3bcca4026c9449e9cdd842b21d805e0e6 100644 (file)
@@ -1040,6 +1040,21 @@ void CAM_Application::logUserEvent( const QString& eventDescription )
   }
 }
 
+void CAM_Application::logStructuredUserEvent( const QString& module,
+                                              const QString& section,
+                                              const QString& action,
+                                              const QString& event,
+                                              const QString& message )
+{
+  const QStringList mes = (QStringList() << module
+                           << section
+                           << action
+                           << event
+                           << message);
+
+  logUserEvent( mes.join( "," ) );
+}
+
 /*!
   \brief Log given action.
   \param action GUI action being logged.
index 77cbe25a8d491be1471ae087bc0dec041e0ddf7b..9045fdb75ad4effc95960ece3dbce11f9846af2b 100644 (file)
@@ -89,6 +89,11 @@ public:
 
   static void         logUserEvent( const QString& );
   static void         logAction( QAction*, const QString& = QString() );
+  static void         logStructuredUserEvent( const QString& module,
+                                              const QString& section,
+                                              const QString& action,
+                                              const QString& event,
+                                              const QString& message = "" );
 
 protected:
   virtual SUIT_Study* createNewStudy();