From bb8e0c4f5a0ce1d89b1ccc5e986b1937ad71e468 Mon Sep 17 00:00:00 2001
From: Raphael Girardot <raphael.girardot@synchrotron-soleil.fr>
Date: Wed, 8 Apr 2020 16:29:21 +0000
Subject: [PATCH] - No more use of println: Prefer using slf4j Logger (will
 help PROBLEM-1604). - Less silent errors and more use of slf4j Logger (will
 help PROBLEM-1604). - Respect java naming convention.

---
 snaparchiver/pom.xml                          |  17 +-
 .../main/java/SnapArchiver/SnapArchiver.java  |  82 +++++----
 snapextractor/pom.xml                         |  14 +-
 .../server/snapextractor/SnapExtractor.java   |   3 +-
 snapmanager/pom.xml                           |  12 +-
 .../SnapManager/CreateNewContextClass.java    |  53 +++---
 .../java/SnapManager/LaunchSnapShotCmd.java   |  50 +++---
 .../java/SnapManager/SetEquipmentsClass.java  |  50 +++---
 .../SetEquipmentsWithCommandClass.java        |  50 +++---
 .../SetEquipmentsWithSnapshotClass.java       | 156 ++++++++----------
 .../main/java/SnapManager/SnapManager.java    |  85 +++++-----
 .../java/SnapManager/SnapManagerClass.java    |  65 ++++----
 .../SnapManager/UpdateSnapCommentClass.java   |  53 +++---
 13 files changed, 314 insertions(+), 376 deletions(-)

diff --git a/snaparchiver/pom.xml b/snaparchiver/pom.xml
index c60b9ab..ee03a15 100644
--- a/snaparchiver/pom.xml
+++ b/snaparchiver/pom.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>fr.soleil.deviceservers</groupId>
@@ -22,12 +21,20 @@
     </developerConnection>
     <url>${scm.url.svn.tango-cs}/archiving/server/snapArchivingServers/snaparchiver</url>
   </scm>
- 
+
   <dependencies>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.tango-controls</groupId>
       <artifactId>TangORB</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.tango-controls</groupId>
+      <artifactId>JTangoServer</artifactId>
+    </dependency>
     <dependency>
       <groupId>fr.soleil.lib</groupId>
       <artifactId>snapArchivingApi</artifactId>
@@ -36,9 +43,5 @@
       <groupId>org.tango-controls</groupId>
       <artifactId>JTangoClientLang</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
   </dependencies>
 </project>
\ No newline at end of file
diff --git a/snaparchiver/src/main/java/SnapArchiver/SnapArchiver.java b/snaparchiver/src/main/java/SnapArchiver/SnapArchiver.java
index 6133de6..539d95c 100644
--- a/snaparchiver/src/main/java/SnapArchiver/SnapArchiver.java
+++ b/snaparchiver/src/main/java/SnapArchiver/SnapArchiver.java
@@ -107,6 +107,8 @@ import java.util.concurrent.Future;
 
 import org.omg.CORBA.SystemException;
 import org.omg.CORBA.UserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tango.utils.DevFailedUtils;
 
 import SnapArchiver.grouplink.UsePluginBuilder;
@@ -143,8 +145,10 @@ import fr.soleil.archiving.snap.api.tools.SnapshotingException;
  * Device States Description:
  */
 // --------- End of States Description ----------
-public class SnapArchiver extends DeviceImpl
-/* WithShutdownRunnable */implements TangoConst {
+public class SnapArchiver extends DeviceImpl/* WithShutdownRunnable */ implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SnapArchiver.class);
+
     protected int state;
     protected SnapshotPersistenceManager manager;
     private final String m_version;
@@ -176,17 +180,17 @@ public class SnapArchiver extends DeviceImpl
      * User identifier (name) used to connect the database for snapshots. <br>
      * <b>Default value : </b> archiver
      */
-    String dbUser;
+    protected String dbUser;
     /**
      * Password used to connect the database for snapshots. <br>
      * <b>Default value : </b> archiver
      */
-    String dbPassword;
+    protected String dbPassword;
     /**
      * The name of the spring beans file <br>
      * <b>Default value : </b> beans.xml
      */
-    String beansFileName;
+    protected String beansFileName;
 
     private final ExecutorService executorService = Executors.newSingleThreadExecutor();
     private final Map<Integer, Future<Integer>> snapshotResults = new HashMap<Integer, Future<Integer>>();
@@ -209,16 +213,12 @@ public class SnapArchiver extends DeviceImpl
     /**
      * Constructor for simulated Time Device Server.
      * 
-     * @param cl
-     *            The DeviceClass object
-     * @param s
-     *            The Device name.
-     * @param version
-     *            The device version
+     * @param cl The DeviceClass object
+     * @param s The Device name.
+     * @param version The device version
      */
     // =========================================================
-    SnapArchiver(DeviceClass cl, String s, String version) throws DevFailed {
-
+    public SnapArchiver(DeviceClass cl, String s, String version) throws DevFailed {
         super(cl, s);
         m_version = version;
         init_device();
@@ -228,17 +228,13 @@ public class SnapArchiver extends DeviceImpl
     /**
      * Constructor for simulated Time Device Server.
      * 
-     * @param cl
-     *            The DeviceClass object
-     * @param s
-     *            The Device name.
-     * @param d
-     *            Device description.
-     * @param version
-     *            The device version
+     * @param cl The DeviceClass object
+     * @param s The Device name.
+     * @param d Device description.
+     * @param version The device version
      */
     // =========================================================
-    SnapArchiver(DeviceClass cl, String s, String d, String version) throws DevFailed {
+    public SnapArchiver(DeviceClass cl, String s, String d, String version) throws DevFailed {
         super(cl, s, d);
         m_version = version;
         init_device();
@@ -251,7 +247,7 @@ public class SnapArchiver extends DeviceImpl
     // =========================================================
     @Override
     public void init_device() throws DevFailed {
-        System.out.println("SnapArchiver() create " + device_name);
+        LOGGER.info("SnapArchiver() create " + device_name);
         // Initialise variables to default values
         // -------------------------------------------
 
@@ -262,7 +258,7 @@ public class SnapArchiver extends DeviceImpl
             manager = factory.getManager(beansFileName, dbUser, dbPassword);
             set_state(DevState.ON);
         } catch (SnapshotingException e) {
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             set_state(DevState.FAULT);
             set_status(e.toString());
         }
@@ -295,7 +291,8 @@ public class SnapArchiver extends DeviceImpl
             dbPassword = SnapConnectionParameters.getSnapPassword();
             isRac = SnapConnectionParameters.getSnapRac();
 
-            SnapConnectionParameters.printSnapConnectionInfoLog();
+            LOGGER.info(SnapConnectionParameters.appendSnapConnectionInfoLog(new StringBuilder("Connection info:\n"))
+                    .toString());
 
         } catch (SnapshotingException e) {
             e.printStackTrace();
@@ -334,7 +331,7 @@ public class SnapArchiver extends DeviceImpl
     // =========================================================
     @Override
     public void always_executed_hook() {
-        // get_logger().info("In always_executed_hook method()");
+        // LOGGER.info("In always_executed_hook method()");
     }
 
     // =========================================================
@@ -350,10 +347,10 @@ public class SnapArchiver extends DeviceImpl
     // =========================================================
     public void trigger_launch_snap_shot(int argin) throws DevFailed {
         if (get_state().equals(DevState.RUNNING)) {
-            DevFailedUtils.throwDevFailed("STATE_ERROR", "snapshot alreadly in progress");
+            throw DevFailedUtils.newDevFailed("STATE_ERROR", "snapshot alreadly in progress");
         }
         set_state(DevState.RUNNING);
-        get_logger().info("Entering trigger_launch_snap_shot()");
+        LOGGER.info("Entering trigger_launch_snap_shot()");
         Future<Integer> snapshotResult = executorService.submit(new SnapshotTask(argin));
         snapshotResults.put(argin, snapshotResult);
 
@@ -412,8 +409,7 @@ public class SnapArchiver extends DeviceImpl
                 group.getMessages();
                 // Map<String, String> messages = group.getMessages();
             } catch (SnapshotingException e) {
-                e.printStackTrace();
-                Util.out2.println("Exception received during TriggerLaunchSnapshot : " + e.toString());
+                LOGGER.error("Exception received during TriggerLaunchSnapshot", e);
                 throw e.toTangoException();
             } finally {
                 SnapArchiver.this.set_state(DevState.ON);
@@ -437,17 +433,17 @@ public class SnapArchiver extends DeviceImpl
      */
     // =========================================================
     public void create_new_context(String[] argin) throws DevFailed {
-        get_logger().info("Entering create_new_context()");
+        LOGGER.info("Entering create_new_context()");
 
         // ---Add your Own code to control device here ---
         SnapContext snapContext = new SnapContext(argin);
         try {
             SnapManagerApi.createContext(snapContext);
         } catch (SnapshotingException e) {
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             throw e.toTangoException();
         }
-        get_logger().info("Exiting create_new_context()");
+        LOGGER.info("Exiting create_new_context()");
     }
 
     // ===================================================================
@@ -462,7 +458,7 @@ public class SnapArchiver extends DeviceImpl
     @Override
     public void read_attr(Attribute attr) throws DevFailed {
         String attr_name = attr.get_name();
-        get_logger().info("In read_attr for attribute " + attr_name);
+        LOGGER.info("In read_attr for attribute " + attr_name);
 
         // Switch on attribute name
         // ---------------------------------
@@ -482,22 +478,18 @@ public class SnapArchiver extends DeviceImpl
             Util tg = Util.init(argv, "SnapArchiver");
             tg.server_init();
 
-            System.out.println("Ready to accept request");
+            LOGGER.info("Ready to accept request");
 
             tg.server_run();
         } catch (OutOfMemoryError ex) {
-            System.err.println("Can't allocate memory !!!!");
-            System.err.println("Exiting");
+            LOGGER.error("Can't allocate memory !!!!");
+            LOGGER.error("Exiting");
         } catch (UserException ex) {
-            Except.print_exception(ex);
-
-            System.err.println("Received a CORBA user exception");
-            System.err.println("Exiting");
+            LOGGER.error("Received a CORBA user exception", ex);
+            LOGGER.error("Exiting");
         } catch (SystemException ex) {
-            Except.print_exception(ex);
-
-            System.err.println("Received a CORBA system exception");
-            System.err.println("Exiting");
+            LOGGER.error("Received a CORBA system exception", ex);
+            LOGGER.error("Exiting");
         }
 
         System.exit(-1);
diff --git a/snapextractor/pom.xml b/snapextractor/pom.xml
index 3ac77c6..67988f1 100644
--- a/snapextractor/pom.xml
+++ b/snapextractor/pom.xml
@@ -24,6 +24,10 @@
   </scm>
  
   <dependencies>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.tango-controls</groupId>
       <artifactId>JTangoServer</artifactId>
@@ -31,16 +35,6 @@
     <dependency>
       <groupId>fr.soleil.lib</groupId>
       <artifactId>snapArchivingApi</artifactId>
-      <exclusions>
-        <exclusion>
-          <artifactId>slf4j-log4j12</artifactId>
-          <groupId>org.slf4j</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>commons-logging</artifactId>
-          <groupId>commons-logging</groupId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.tango-controls</groupId>
diff --git a/snapextractor/src/main/java/org/tango/server/snapextractor/SnapExtractor.java b/snapextractor/src/main/java/org/tango/server/snapextractor/SnapExtractor.java
index 5a69d7a..681d15c 100644
--- a/snapextractor/src/main/java/org/tango/server/snapextractor/SnapExtractor.java
+++ b/snapextractor/src/main/java/org/tango/server/snapextractor/SnapExtractor.java
@@ -371,7 +371,8 @@ public class SnapExtractor {
         dbUser = getProperty(dbUser, SnapConnectionParameters.getSnapUser());
         dbPassword = getProperty(dbPassword, SnapConnectionParameters.getSnapPassword());
         isRac = getProperty(isRac, SnapConnectionParameters.getSnapRac());
-        SnapConnectionParameters.printSnapConnectionInfoLog();
+        logger.info(SnapConnectionParameters.appendSnapConnectionInfoLog(new StringBuilder("Connection info:\n"))
+                .toString());
     }
 
     private String getProperty(final String original, final String newValue) {
diff --git a/snapmanager/pom.xml b/snapmanager/pom.xml
index f2ea697..0b3d280 100644
--- a/snapmanager/pom.xml
+++ b/snapmanager/pom.xml
@@ -24,10 +24,18 @@
   </scm>
 
   <dependencies>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.tango-controls</groupId>
       <artifactId>TangORB</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.tango-controls</groupId>
+      <artifactId>JTangoServer</artifactId>
+    </dependency>
     <dependency>
       <groupId>fr.soleil.lib</groupId>
       <artifactId>snapArchivingApi</artifactId>
@@ -36,9 +44,5 @@
       <groupId>org.tango-controls</groupId>
       <artifactId>JTangoClientLang</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
   </dependencies>
 </project>
\ No newline at end of file
diff --git a/snapmanager/src/main/java/SnapManager/CreateNewContextClass.java b/snapmanager/src/main/java/SnapManager/CreateNewContextClass.java
index 60c6459..c59ba73 100644
--- a/snapmanager/src/main/java/SnapManager/CreateNewContextClass.java
+++ b/snapmanager/src/main/java/SnapManager/CreateNewContextClass.java
@@ -46,13 +46,14 @@
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
 import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command is used to register a snapShot context. All
@@ -62,16 +63,16 @@ import fr.esrf.TangoDs.Util;
  */
 
 public class CreateNewContextClass extends Command implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(CreateNewContextClass.class);
+
     // ===============================================================
     /**
      * Constructor for Command class CreateNewContextClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param out
-     *            argout type
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
      */
     // ===============================================================
     public CreateNewContextClass(String name, int in, int out) {
@@ -82,16 +83,11 @@ public class CreateNewContextClass extends Command implements TangoConst {
     /**
      * Constructor for Command class CreateNewContextClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
      */
     // ===============================================================
     public CreateNewContextClass(String name, int in, int out, String in_comments, String out_comments) {
@@ -102,21 +98,16 @@ public class CreateNewContextClass extends Command implements TangoConst {
     /**
      * Constructor for Command class CreateNewContextClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
-     * @param level
-     *            The command display type OPERATOR or EXPERT
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
      */
     // ===============================================================
-    public CreateNewContextClass(String name, int in, int out, String in_comments, String out_comments, DispLevel level) {
+    public CreateNewContextClass(String name, int in, int out, String in_comments, String out_comments,
+            DispLevel level) {
         super(name, in, out, in_comments, out_comments, level);
     }
 
@@ -127,7 +118,7 @@ public class CreateNewContextClass extends Command implements TangoConst {
     // ===============================================================
     @Override
     public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-        Util.out2.println("CreateNewContextClass.execute(): arrived");
+        LOGGER.info("CreateNewContextClass.execute(): arrived");
         String[] argin = extract_DevVarStringArray(in_any);
         return insert(((SnapManager) (device)).create_new_context(argin));
     }
diff --git a/snapmanager/src/main/java/SnapManager/LaunchSnapShotCmd.java b/snapmanager/src/main/java/SnapManager/LaunchSnapShotCmd.java
index 4f45425..b2dedb7 100644
--- a/snapmanager/src/main/java/SnapManager/LaunchSnapShotCmd.java
+++ b/snapmanager/src/main/java/SnapManager/LaunchSnapShotCmd.java
@@ -55,6 +55,8 @@
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
@@ -62,7 +64,6 @@ import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.Except;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command is used to trigger a snapShot. All
@@ -71,16 +72,16 @@ import fr.esrf.TangoDs.Util;
  */
 
 public class LaunchSnapShotCmd extends Command implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(LaunchSnapShotCmd.class);
+
     // ===============================================================
     /**
      * Constructor for Command class LaunchSnapShotCmd
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param out
-     *            argout type
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
      */
     // ===============================================================
     public LaunchSnapShotCmd(String name, int in, int out) {
@@ -91,16 +92,11 @@ public class LaunchSnapShotCmd extends Command implements TangoConst {
     /**
      * Constructor for Command class LaunchSnapShotCmd
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
      */
     // ===============================================================
     public LaunchSnapShotCmd(String name, int in, int out, String in_comments, String out_comments) {
@@ -111,18 +107,12 @@ public class LaunchSnapShotCmd extends Command implements TangoConst {
     /**
      * Constructor for Command class LaunchSnapShotCmd
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
-     * @param level
-     *            The command display type OPERATOR or EXPERT
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
      */
     // ===============================================================
     public LaunchSnapShotCmd(String name, int in, int out, String in_comments, String out_comments, DispLevel level) {
@@ -136,7 +126,7 @@ public class LaunchSnapShotCmd extends Command implements TangoConst {
     // ===============================================================
     @Override
     public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-        Util.out2.println("LaunchSnapShotCmd.execute(): arrived");
+        LOGGER.info("LaunchSnapShotCmd.execute(): arrived");
         int argin = extract_DevLong(in_any);
         if (argin < 0) {
             Except.throw_exception("INPUT_ERROR", "Invalid Context ID", "SnapManager.LaunchSnapshot");
diff --git a/snapmanager/src/main/java/SnapManager/SetEquipmentsClass.java b/snapmanager/src/main/java/SnapManager/SetEquipmentsClass.java
index 2bce623..74cfe42 100644
--- a/snapmanager/src/main/java/SnapManager/SetEquipmentsClass.java
+++ b/snapmanager/src/main/java/SnapManager/SetEquipmentsClass.java
@@ -32,29 +32,30 @@
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
 import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command is used to set values to equipments.
  */
 
 public class SetEquipmentsClass extends Command implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SetEquipmentsClass.class);
+
     // ===============================================================
     /**
      * Constructor for Command class SetEquipmentsClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param out
-     *            argout type
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
      */
     // ===============================================================
     public SetEquipmentsClass(String name, int in, int out) {
@@ -65,16 +66,11 @@ public class SetEquipmentsClass extends Command implements TangoConst {
     /**
      * Constructor for Command class SetEquipmentsClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
      */
     // ===============================================================
     public SetEquipmentsClass(String name, int in, int out, String in_comments, String out_comments) {
@@ -85,18 +81,12 @@ public class SetEquipmentsClass extends Command implements TangoConst {
     /**
      * Constructor for Command class SetEquipmentsClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
-     * @param level
-     *            The command display type OPERATOR or EXPERT
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
      */
     // ===============================================================
     public SetEquipmentsClass(String name, int in, int out, String in_comments, String out_comments, DispLevel level) {
@@ -110,7 +100,7 @@ public class SetEquipmentsClass extends Command implements TangoConst {
     // ===============================================================
     @Override
     public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-        Util.out2.println("SetEquipmentsClass.execute(): arrived");
+        LOGGER.info("SetEquipmentsClass.execute(): arrived");
         String[] argin = extract_DevVarStringArray(in_any);
         ((SnapManager) (device)).set_equipments(argin);
         return insert();
diff --git a/snapmanager/src/main/java/SnapManager/SetEquipmentsWithCommandClass.java b/snapmanager/src/main/java/SnapManager/SetEquipmentsWithCommandClass.java
index 2f5357b..b4831cb 100644
--- a/snapmanager/src/main/java/SnapManager/SetEquipmentsWithCommandClass.java
+++ b/snapmanager/src/main/java/SnapManager/SetEquipmentsWithCommandClass.java
@@ -5,29 +5,30 @@
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
 import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command is used to set command to equipments.
  */
 
 public class SetEquipmentsWithCommandClass extends Command implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SetEquipmentsWithCommandClass.class);
+
     // ===============================================================
     /**
      * Constructor for Command class SetEquipmentsWithCommandClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param out
-     *            argout type
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
      */
     // ===============================================================
     public SetEquipmentsWithCommandClass(String name, int in, int out) {
@@ -38,16 +39,11 @@ public class SetEquipmentsWithCommandClass extends Command implements TangoConst
     /**
      * Constructor for Command class SetEquipmentsWithCommandClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
      */
     // ===============================================================
     public SetEquipmentsWithCommandClass(String name, int in, int out, String in_comments, String out_comments) {
@@ -58,18 +54,12 @@ public class SetEquipmentsWithCommandClass extends Command implements TangoConst
     /**
      * Constructor for Command class SetEquipmentsWithCommandClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
-     * @param level
-     *            The command display type OPERATOR or EXPERT
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
      */
     // ===============================================================
     public SetEquipmentsWithCommandClass(String name, int in, int out, String in_comments, String out_comments,
@@ -84,7 +74,7 @@ public class SetEquipmentsWithCommandClass extends Command implements TangoConst
     // ===============================================================
     @Override
     public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-        Util.out2.println("SetEquipmentsWithCommandClass.execute(): arrived");
+        LOGGER.info("SetEquipmentsWithCommandClass.execute(): arrived");
         String[] argin = extract_DevVarStringArray(in_any);
 
         return insert(((SnapManager) (device)).set_equipments_with_command(argin));
diff --git a/snapmanager/src/main/java/SnapManager/SetEquipmentsWithSnapshotClass.java b/snapmanager/src/main/java/SnapManager/SetEquipmentsWithSnapshotClass.java
index d5e7054..d1df9b9 100644
--- a/snapmanager/src/main/java/SnapManager/SetEquipmentsWithSnapshotClass.java
+++ b/snapmanager/src/main/java/SnapManager/SetEquipmentsWithSnapshotClass.java
@@ -40,109 +40,99 @@
 //=============================================================================
 
 /**
- * @author	$Author: chinkumo $
- * @version	$Revision: 1.3 $
+ * @author $Author: chinkumo $
+ * @version $Revision: 1.3 $
  */
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
 import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command is used to set values to equipments.
  */
 
-public class SetEquipmentsWithSnapshotClass extends Command implements
-		TangoConst {
-	// ===============================================================
-	/**
-	 * Constructor for Command class SetEquipmentsWithSnapshotClass
-	 * 
-	 * @param name
-	 *            command name
-	 * @param in
-	 *            argin type
-	 * @param out
-	 *            argout type
-	 */
-	// ===============================================================
-	public SetEquipmentsWithSnapshotClass(String name, int in, int out) {
-		super(name, in, out);
-	}
+public class SetEquipmentsWithSnapshotClass extends Command implements TangoConst {
 
-	// ===============================================================
-	/**
-	 * Constructor for Command class SetEquipmentsWithSnapshotClass
-	 * 
-	 * @param name
-	 *            command name
-	 * @param in
-	 *            argin type
-	 * @param in_comments
-	 *            argin description
-	 * @param out
-	 *            argout type
-	 * @param out_comments
-	 *            argout description
-	 */
-	// ===============================================================
-	public SetEquipmentsWithSnapshotClass(String name, int in, int out,
-			String in_comments, String out_comments) {
-		super(name, in, out, in_comments, out_comments);
-	}
+    private static final Logger LOGGER = LoggerFactory.getLogger(SetEquipmentsWithSnapshotClass.class);
 
-	// ===============================================================
-	/**
-	 * Constructor for Command class SetEquipmentsWithSnapshotClass
-	 * 
-	 * @param name
-	 *            command name
-	 * @param in
-	 *            argin type
-	 * @param in_comments
-	 *            argin description
-	 * @param out
-	 *            argout type
-	 * @param out_comments
-	 *            argout description
-	 * @param level
-	 *            The command display type OPERATOR or EXPERT
-	 */
-	// ===============================================================
-	public SetEquipmentsWithSnapshotClass(String name, int in, int out,
-			String in_comments, String out_comments, DispLevel level) {
-		super(name, in, out, in_comments, out_comments, level);
-	}
+    // ===============================================================
+    /**
+     * Constructor for Command class SetEquipmentsWithSnapshotClass
+     * 
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
+     */
+    // ===============================================================
+    public SetEquipmentsWithSnapshotClass(String name, int in, int out) {
+        super(name, in, out);
+    }
 
-	// ===============================================================
-	/**
-	 * return the result of the device's command.
-	 */
-	// ===============================================================
-	public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-		Util.out2.println("SetEquipmentsWithSnapshotClass.execute(): arrived");
-		String[] argin = extract_DevVarStringArray(in_any);
-		((SnapManager) (device)).set_equipments_with_snapshot(argin);
-		return insert();
-	}
+    // ===============================================================
+    /**
+     * Constructor for Command class SetEquipmentsWithSnapshotClass
+     * 
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     */
+    // ===============================================================
+    public SetEquipmentsWithSnapshotClass(String name, int in, int out, String in_comments, String out_comments) {
+        super(name, in, out, in_comments, out_comments);
+    }
 
-	// ===============================================================
-	/**
-	 * Check if it is allowed to execute the command.
-	 */
-	// ===============================================================
-	public boolean is_allowed(DeviceImpl device, Any data_in) {
-		// End of Generated Code
+    // ===============================================================
+    /**
+     * Constructor for Command class SetEquipmentsWithSnapshotClass
+     * 
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
+     */
+    // ===============================================================
+    public SetEquipmentsWithSnapshotClass(String name, int in, int out, String in_comments, String out_comments,
+            DispLevel level) {
+        super(name, in, out, in_comments, out_comments, level);
+    }
 
-		// Re-Start of Generated Code
-		return true;
-	}
+    // ===============================================================
+    /**
+     * return the result of the device's command.
+     */
+    // ===============================================================
+    @Override
+    public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
+        LOGGER.info("SetEquipmentsWithSnapshotClass.execute(): arrived");
+        String[] argin = extract_DevVarStringArray(in_any);
+        ((SnapManager) (device)).set_equipments_with_snapshot(argin);
+        return insert();
+    }
+
+    // ===============================================================
+    /**
+     * Check if it is allowed to execute the command.
+     */
+    // ===============================================================
+    @Override
+    public boolean is_allowed(DeviceImpl device, Any data_in) {
+        // End of Generated Code
+
+        // Re-Start of Generated Code
+        return true;
+    }
 }
 
 // -----------------------------------------------------------------------------
diff --git a/snapmanager/src/main/java/SnapManager/SnapManager.java b/snapmanager/src/main/java/SnapManager/SnapManager.java
index 7f89449..5e2a359 100644
--- a/snapmanager/src/main/java/SnapManager/SnapManager.java
+++ b/snapmanager/src/main/java/SnapManager/SnapManager.java
@@ -124,6 +124,8 @@ import java.util.concurrent.Future;
 
 import org.omg.CORBA.SystemException;
 import org.omg.CORBA.UserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tango.utils.DevFailedUtils;
 
 import fr.esrf.Tango.DevError;
@@ -161,8 +163,10 @@ import fr.soleil.tango.clientapi.TangoCommand;
  * Device States Description:
  */
 // --------- End of States Description ----------
-public class SnapManager extends DeviceImpl
-/* WithShutdownRunnable */implements TangoConst {
+public class SnapManager extends DeviceImpl/* WithShutdownRunnable */ implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SnapManager.class);
+
     protected int state;
     private final String m_version;
     // --------- Start of attributes data members ----------
@@ -174,12 +178,12 @@ public class SnapManager extends DeviceImpl
      * User identifier (name) used to connect the database for snapshots. <br>
      * <b>Default value : </b> archiver
      */
-    String dbUser;
+    protected String dbUser;
     /**
      * Password used to connect the database for snapshots. <br>
      * <b>Default value : </b> archiver
      */
-    String dbPassword;
+    protected String dbPassword;
 
     // --------- End of properties data members ----------
 
@@ -208,7 +212,7 @@ public class SnapManager extends DeviceImpl
      *            The device version
      */
     // =========================================================
-    SnapManager(DeviceClass cl, String s, String version) throws DevFailed {
+    public SnapManager(DeviceClass cl, String s, String version) throws DevFailed {
         super(cl, s);
         m_version = version;
         init_device();
@@ -228,7 +232,7 @@ public class SnapManager extends DeviceImpl
      *            The device version
      */
     // =========================================================
-    SnapManager(DeviceClass cl, String s, String d, String version) throws DevFailed {
+    public SnapManager(DeviceClass cl, String s, String d, String version) throws DevFailed {
         super(cl, s, d);
         m_version = version;
         init_device();
@@ -241,7 +245,7 @@ public class SnapManager extends DeviceImpl
     // =========================================================
     @Override
     public void init_device() throws DevFailed {
-        System.out.println("SnapManager() create " + device_name);
+        LOGGER.info("SnapManager() create " + device_name);
 
         // Initialise variables to default values
         // -------------------------------------------
@@ -252,7 +256,7 @@ public class SnapManager extends DeviceImpl
             SnapManagerApi.initSnapConnection(dbHost, dbName, dbSchema, dbUser, dbPassword, isRac);
             set_state(DevState.ON);
         } catch (SnapshotingException e) {
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             set_state(DevState.FAULT);
             set_status(e.toString());
             // throw e.toTangoException();
@@ -286,7 +290,8 @@ public class SnapManager extends DeviceImpl
             dbPassword = SnapConnectionParameters.getSnapPassword();
             isRac = SnapConnectionParameters.getSnapRac();
 
-            SnapConnectionParameters.printSnapConnectionInfoLog();
+            LOGGER.info(SnapConnectionParameters.appendSnapConnectionInfoLog(new StringBuilder("Connection info:\n"))
+                    .toString());
 
         } catch (SnapshotingException e) {
             e.printStackTrace();
@@ -300,7 +305,7 @@ public class SnapManager extends DeviceImpl
     // =========================================================
     @Override
     public void always_executed_hook() {
-        // get_logger().info("In always_executed_hook method()");
+        // LOGGER.info("In always_executed_hook method()");
     }
 
     // =========================================================
@@ -321,17 +326,17 @@ public class SnapManager extends DeviceImpl
     // =========================================================
     public int create_new_context(String[] argin) throws DevFailed {
         int argout = -1;
-        get_logger().info("Entering create_new_context()");
+        LOGGER.info("Entering create_new_context()");
 
         // ---Add your Own code to control device here ---
         SnapContext snapContext = new SnapContext(argin);
         try {
             argout = SnapManagerApi.createContext(snapContext);
         } catch (SnapshotingException e) {
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             throw e.toTangoException();
         }
-        get_logger().info("Exiting create_new_context()");
+        LOGGER.info("Exiting create_new_context()");
         return argout;
     }
 
@@ -347,7 +352,7 @@ public class SnapManager extends DeviceImpl
      */
     // =========================================================
     public void launch_snap_shot(int argin) throws DevFailed {
-        get_logger().info("Entering launch_snap_shot()");
+        LOGGER.info("Entering launch_snap_shot()");
         if (get_state().equals(DevState.RUNNING)) {
             DevFailedUtils.throwDevFailed("STATE_ERROR", "snapshot alreadly in progress");
         }
@@ -390,12 +395,12 @@ public class SnapManager extends DeviceImpl
             try {
                 snapShot = m_manager.launchSnapshot(context);
             } catch (SnapshotingException e) {
-                get_logger().warn(e.toString(), e);
+                LOGGER.warn(e.toString(), e);
                 throw e.toTangoException();
             } finally {
                 SnapManager.this.set_state(DevState.ON);
             }
-            get_logger().info("Exiting launch_snap_shot()");
+            LOGGER.info("Exiting launch_snap_shot()");
 
             return snapShot.getId_snap();
         }
@@ -411,7 +416,7 @@ public class SnapManager extends DeviceImpl
      */
     // =========================================================
     public void set_equipments_with_snapshot(String[] argin) throws DevFailed {
-        get_logger().info("Entering set_equipments_with_snapshot() xxx");
+        LOGGER.info("Entering set_equipments_with_snapshot() xxx");
         try {
             // System.out.println("set_equipments_with_snapshot(String[] argin)");
             Snapshot snapShot = new Snapshot(argin);
@@ -420,7 +425,7 @@ public class SnapManager extends DeviceImpl
             SnapManagerApi.TriggerSetEquipments(snapShot);
         } catch (SnapshotingException e) {
             e.printStackTrace();
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             throw e.toTangoException();
         } catch (Exception e) {
             e.printStackTrace();
@@ -428,7 +433,7 @@ public class SnapManager extends DeviceImpl
         } catch (Throwable t) {
             t.printStackTrace();
         }
-        get_logger().info("Exiting set_equipments_with_snapshot()");
+        LOGGER.info("Exiting set_equipments_with_snapshot()");
     }
 
     // =========================================================
@@ -506,7 +511,7 @@ public class SnapManager extends DeviceImpl
                                 value = attributeSnap.getReadValue();
                             }
                         }
-                        System.out.println(command_name + " with " + value + " on " + attributeSnap.getdeviceName());
+                        LOGGER.info(command_name + " with " + value + " on " + attributeSnap.getdeviceName());
                         cmd.execute(value);
                         if (!cmd.isArginVoid()) {
                             result.add(cmd.extractToString(","));
@@ -527,7 +532,8 @@ public class SnapManager extends DeviceImpl
         } catch (SnapshotingException e) {
             Except.throw_exception("CONFIGURATION_ERROR", e.getMessage(), "SnapManager.SetEquipmentsWithCommand");
         } catch (NumberFormatException e1) {
-            Except.throw_exception("CONFIGURATION_ERROR", "Invalid snapshot ID", "SnapManager.SetEquipmentsWithCommand");
+            Except.throw_exception("CONFIGURATION_ERROR", "Invalid snapshot ID",
+                    "SnapManager.SetEquipmentsWithCommand");
 
         }
         return "";
@@ -547,8 +553,9 @@ public class SnapManager extends DeviceImpl
         }
         for (int i = 1; i < selectedAttributes.length; i++) {
             if (selectedAttributes[i].getDataFormat() != format) {
-                Except.throw_exception("CONFIGURATION_ERROR", "Some attributes have incompatible format : "
-                        + selectedAttributes[i].getDataFormat() + " and " + format,
+                Except.throw_exception(
+                        "CONFIGURATION_ERROR", "Some attributes have incompatible format : "
+                                + selectedAttributes[i].getDataFormat() + " and " + format,
                         "SnapManager.SetEquipmentsWithCommand");
                 return false;
             } else if (numberOfOccurrences(selectedAttributes, selectedAttributes[i].getdeviceName()) > 1) {
@@ -604,7 +611,7 @@ public class SnapManager extends DeviceImpl
      */
     // =========================================================
     public void set_equipments(String[] argin) throws DevFailed {
-        get_logger().info("Entering set_equipments() xxx");
+        LOGGER.info("Entering set_equipments() xxx");
         // System.out.println("set_equipments(String[] argin)");
         // ---Add your Own code to control device here ---
         // System.out.println("snapshot : " + snapShot.toString());
@@ -631,7 +638,7 @@ public class SnapManager extends DeviceImpl
                 }
                 SnapManagerApi.TriggerSetEquipments(snapShot);
             } catch (SnapshotingException e) {
-                get_logger().warn(e.toString(), e);
+                LOGGER.warn(e.toString(), e);
                 throw e.toTangoException();
             } catch (NumberFormatException e) {
                 Except.throw_exception("CONFIGURATION_ERROR", "Wrong parameters values ", "SnapManager.SetEquipments");
@@ -641,7 +648,7 @@ public class SnapManager extends DeviceImpl
                 t.printStackTrace();
             }
         }
-        get_logger().info("Exiting set_equipments()");
+        LOGGER.info("Exiting set_equipments()");
     }
 
     // =========================================================
@@ -655,7 +662,7 @@ public class SnapManager extends DeviceImpl
      */
     // =========================================================
     public void update_snap_comment(DevVarLongStringArray argin) throws DevFailed {
-        get_logger().info("Entering update_snap_comment()");
+        LOGGER.info("Entering update_snap_comment()");
 
         // ---Add your Own code to control device here ---
         int id_snap = argin.lvalue[0];
@@ -663,10 +670,10 @@ public class SnapManager extends DeviceImpl
         try {
             SnapManagerApi.updateSnapComment(id_snap, comment);
         } catch (SnapshotingException e) {
-            get_logger().warn(e.toString(), e);
+            LOGGER.warn(e.toString(), e);
             throw e.toTangoException();
         }
-        get_logger().info("Exiting update_snap_comment()");
+        LOGGER.info("Exiting update_snap_comment()");
     }
 
     public String getSnapComment(int snapID) throws DevFailed {
@@ -689,7 +696,7 @@ public class SnapManager extends DeviceImpl
     @Override
     public void read_attr(Attribute attr) throws DevFailed {
         String attr_name = attr.get_name();
-        get_logger().info("In read_attr for attribute " + attr_name);
+        LOGGER.info("In read_attr for attribute " + attr_name);
 
         // Switch on attribute name
         // ---------------------------------
@@ -709,24 +716,20 @@ public class SnapManager extends DeviceImpl
             Util tg = Util.init(argv, "SnapManager");
             tg.server_init();
 
-            System.out.println("Ready to accept request");
+            LOGGER.info("Ready to accept request");
 
             tg.server_run();
         }
 
         catch (OutOfMemoryError ex) {
-            System.err.println("Can't allocate memory !!!!");
-            System.err.println("Exiting");
+            LOGGER.error("Can't allocate memory !!!!", ex);
+            LOGGER.error("Exiting");
         } catch (UserException ex) {
-            Except.print_exception(ex);
-
-            System.err.println("Received a CORBA user exception");
-            System.err.println("Exiting");
+            LOGGER.error("Received a CORBA user exception", ex);
+            LOGGER.error("Exiting");
         } catch (SystemException ex) {
-            Except.print_exception(ex);
-
-            System.err.println("Received a CORBA system exception");
-            System.err.println("Exiting");
+            LOGGER.error("Received a CORBA system exception", ex);
+            LOGGER.error("Exiting");
         }
 
         System.exit(-1);
diff --git a/snapmanager/src/main/java/SnapManager/SnapManagerClass.java b/snapmanager/src/main/java/SnapManager/SnapManagerClass.java
index 8b89877..0052a56 100644
--- a/snapmanager/src/main/java/SnapManager/SnapManagerClass.java
+++ b/snapmanager/src/main/java/SnapManager/SnapManagerClass.java
@@ -70,6 +70,9 @@ import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.Vector;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import fr.esrf.Tango.AttrWriteType;
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DispLevel;
@@ -83,6 +86,9 @@ import fr.esrf.TangoDs.TemplCommandInOut;
 import fr.esrf.TangoDs.Util;
 
 public class SnapManagerClass extends DeviceClass implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SnapManagerClass.class);
+
     // --------- Start of properties data members ----------
 
     /**
@@ -90,17 +96,17 @@ public class SnapManagerClass extends DeviceClass implements TangoConst {
      * can be the computer name or its IP address. <br>
      * <b>Default value : </b> localhost.
      */
-    String dbHost;
+    private String dbHost;
     /**
      * Database name.<br>
      * <b>Default value : </b> hdb
      */
-    String dbName;
+    private String dbName;
     /**
      * Database schema name.<br>
      * <b>Default value : </b> snap
      */
-    String dbSchema;
+    private String dbSchema;
 
     // --------- End of properties data members ----------
 
@@ -128,8 +134,8 @@ public class SnapManagerClass extends DeviceClass implements TangoConst {
     // ===================================================================
     public static SnapManagerClass instance() {
         if (_instance == null) {
-            System.err.println("SnapManagerClass is not initialised !!!");
-            System.err.println("Exiting");
+            LOGGER.error("SnapManagerClass is not initialised !!!");
+            LOGGER.error("Exiting");
             System.exit(-1);
         }
         return _instance;
@@ -165,11 +171,11 @@ public class SnapManagerClass extends DeviceClass implements TangoConst {
     protected SnapManagerClass(final String name) throws DevFailed {
         super(name);
 
-        Util.out2.println("Entering SnapManagerClass constructor");
+        LOGGER.info("Entering SnapManagerClass constructor");
         // write_class_property();
         get_class_property();
 
-        Util.out2.println("Leaving SnapManagerClass constructor");
+        LOGGER.info("Leaving SnapManagerClass constructor");
     }
 
     // ===================================================================
@@ -184,33 +190,26 @@ public class SnapManagerClass extends DeviceClass implements TangoConst {
         command_list.addElement(new CreateNewContextClass("CreateNewContext", Tango_DEVVAR_STRINGARRAY, Tango_DEV_LONG,
                 "All the informations usefull to create a context ,Snapshot pattern).", "The new assigned context ID",
                 DispLevel.OPERATOR));
-        command_list.addElement(new SetEquipmentsWithSnapshotClass("SetEquipmentsWithSnapshot",
-                Tango_DEVVAR_STRINGARRAY, Tango_DEV_VOID, "The snapshot from which equipments are set.", "",
-                DispLevel.OPERATOR));
-
-        command_list
-                .addElement(new SetEquipmentsWithCommandClass(
-                        "SetEquipmentsWithCommand",
-                        Tango_DEVVAR_STRINGARRAY,
-                        Tango_DEV_STRING,
-                        "The command name,  STORED_READ_VALUE || STORED_WRITE_VALUE ,\n and the snapshot ID from which equipments are set.",
-                        "", DispLevel.OPERATOR));
-
         command_list
-                .addElement(new SetEquipmentsClass(
-                        "SetEquipments",
-                        Tango_DEVVAR_STRINGARRAY,
-                        Tango_DEV_VOID,
-                        "* First Case: Setpoint is  done on all the snapshot attributes:\n"
-                                + "  - argin[0]= the snap identifier\n"
-                                + "  - argin[1]=STORED_READ_VALUE (Setpoint with theirs read values) or STORED_WRITE_VALUE (Setpoint with theirs write values)\n\n"
-                                + "* Second Case: Setpoint is done on a set of the snapshot attributes:\n "
-                                + "  - argin[0]= the snap identifier\n" + "  - argin[1]=the number of attributes.\n"
-                                + " Let us note index the last index used (for example, at this point,index = 2).\n"
-                                + "  - argin[index]=NEW_VALUE or STORED_READ_VALUE or STORED_WRITE_VALUE\n"
-                                + "  - argin[index+1]= the attribut name\n"
-                                + "  - argin[index+2]= the value to set when NEW_VALUE is requested", "",
-                        DispLevel.OPERATOR));
+                .addElement(new SetEquipmentsWithSnapshotClass("SetEquipmentsWithSnapshot", Tango_DEVVAR_STRINGARRAY,
+                        Tango_DEV_VOID, "The snapshot from which equipments are set.", "", DispLevel.OPERATOR));
+
+        command_list.addElement(new SetEquipmentsWithCommandClass("SetEquipmentsWithCommand", Tango_DEVVAR_STRINGARRAY,
+                Tango_DEV_STRING,
+                "The command name,  STORED_READ_VALUE || STORED_WRITE_VALUE ,\n and the snapshot ID from which equipments are set.",
+                "", DispLevel.OPERATOR));
+
+        command_list.addElement(new SetEquipmentsClass("SetEquipments", Tango_DEVVAR_STRINGARRAY, Tango_DEV_VOID,
+                "* First Case: Setpoint is  done on all the snapshot attributes:\n"
+                        + "  - argin[0]= the snap identifier\n"
+                        + "  - argin[1]=STORED_READ_VALUE (Setpoint with theirs read values) or STORED_WRITE_VALUE (Setpoint with theirs write values)\n\n"
+                        + "* Second Case: Setpoint is done on a set of the snapshot attributes:\n "
+                        + "  - argin[0]= the snap identifier\n" + "  - argin[1]=the number of attributes.\n"
+                        + " Let us note index the last index used (for example, at this point,index = 2).\n"
+                        + "  - argin[index]=NEW_VALUE or STORED_READ_VALUE or STORED_WRITE_VALUE\n"
+                        + "  - argin[index+1]= the attribut name\n"
+                        + "  - argin[index+2]= the value to set when NEW_VALUE is requested",
+                "", DispLevel.OPERATOR));
 
         command_list.addElement(new UpdateSnapCommentClass("UpdateSnapComment", Tango_DEVVAR_LONGSTRINGARRAY,
                 Tango_DEV_VOID, "1) snapshot identifier 2) The new comment", "", DispLevel.OPERATOR));
diff --git a/snapmanager/src/main/java/SnapManager/UpdateSnapCommentClass.java b/snapmanager/src/main/java/SnapManager/UpdateSnapCommentClass.java
index c1adedf..8f7a9b9 100644
--- a/snapmanager/src/main/java/SnapManager/UpdateSnapCommentClass.java
+++ b/snapmanager/src/main/java/SnapManager/UpdateSnapCommentClass.java
@@ -34,6 +34,8 @@
 package SnapManager;
 
 import org.omg.CORBA.Any;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import fr.esrf.Tango.DevFailed;
 import fr.esrf.Tango.DevVarLongStringArray;
@@ -41,23 +43,22 @@ import fr.esrf.Tango.DispLevel;
 import fr.esrf.TangoDs.Command;
 import fr.esrf.TangoDs.DeviceImpl;
 import fr.esrf.TangoDs.TangoConst;
-import fr.esrf.TangoDs.Util;
 
 /**
  * Class Description: This command updates the comment of given snapshot
  * 
  */
 public class UpdateSnapCommentClass extends Command implements TangoConst {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(UpdateSnapCommentClass.class);
+
     // ===============================================================
     /**
      * Constructor for Command class UpdateSnapCommentClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param out
-     *            argout type
+     * @param name command name
+     * @param in argin type
+     * @param out argout type
      */
     // ===============================================================
     public UpdateSnapCommentClass(String name, int in, int out) {
@@ -68,16 +69,11 @@ public class UpdateSnapCommentClass extends Command implements TangoConst {
     /**
      * Constructor for Command class UpdateSnapCommentClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
      */
     // ===============================================================
     public UpdateSnapCommentClass(String name, int in, int out, String in_comments, String out_comments) {
@@ -88,21 +84,16 @@ public class UpdateSnapCommentClass extends Command implements TangoConst {
     /**
      * Constructor for Command class UpdateSnapCommentClass
      * 
-     * @param name
-     *            command name
-     * @param in
-     *            argin type
-     * @param in_comments
-     *            argin description
-     * @param out
-     *            argout type
-     * @param out_comments
-     *            argout description
-     * @param level
-     *            The command display type OPERATOR or EXPERT
+     * @param name command name
+     * @param in argin type
+     * @param in_comments argin description
+     * @param out argout type
+     * @param out_comments argout description
+     * @param level The command display type OPERATOR or EXPERT
      */
     // ===============================================================
-    public UpdateSnapCommentClass(String name, int in, int out, String in_comments, String out_comments, DispLevel level) {
+    public UpdateSnapCommentClass(String name, int in, int out, String in_comments, String out_comments,
+            DispLevel level) {
         super(name, in, out, in_comments, out_comments, level);
     }
 
@@ -113,7 +104,7 @@ public class UpdateSnapCommentClass extends Command implements TangoConst {
     // ===============================================================
     @Override
     public Any execute(DeviceImpl device, Any in_any) throws DevFailed {
-        Util.out2.println("UpdateSnapCommentClass.execute(): arrived");
+        LOGGER.info("UpdateSnapCommentClass.execute(): arrived");
         DevVarLongStringArray argin = extract_DevVarLongStringArray(in_any);
         ((SnapManager) (device)).update_snap_comment(argin);
         return insert();
-- 
GitLab