[openrtm-commit:01737] r551 - in trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview: . model/manager/impl ui/dialog

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 2月 22日 (月) 13:49:24 JST


Author: ga
Date: 2016-02-22 13:49:24 +0900 (Mon, 22 Feb 2016)
New Revision: 551

Modified:
   trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/NameServiceViewPlugin.java
   trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/model/manager/impl/NameServerManagerImpl.java
   trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/dialog/NameServerSectionsDialog.java
Log:
Modified Logger #3211

Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/NameServiceViewPlugin.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/NameServiceViewPlugin.java	2016-02-20 17:40:30 UTC (rev 550)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/NameServiceViewPlugin.java	2016-02-22 04:49:24 UTC (rev 551)
@@ -1,17 +1,22 @@
 package jp.go.aist.rtm.nameserviceview;
 
-import java.util.logging.Logger;
+import jp.go.aist.rtm.toolscommon.profiles.util.LoggerUtil;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The activator class controls the plug-in life cycle
  */
 public class NameServiceViewPlugin extends AbstractUIPlugin {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(NameServiceViewPlugin.class);
+
 	// The plug-in ID
 	private static final String PLUGIN_ID = "jp.go.aist.rtm.nameserviceview";
 
@@ -22,8 +27,10 @@
 	 * The constructor
 	 */
 	public NameServiceViewPlugin() {
+		LoggerUtil.setup();
+		LOGGER.trace("NameServiceViewPlugin: START");
+
 		plugin = this;
-		getLogger();
 	}
 
 	/*
@@ -91,13 +98,4 @@
 		return result;
 	}
 
-	static Logger log;
-
-	public static Logger getLogger() {
-		if (log == null) {
-			log = Logger.getLogger(PLUGIN_ID);
-		}
-		return log;
-	}
-
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/model/manager/impl/NameServerManagerImpl.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/model/manager/impl/NameServerManagerImpl.java	2016-02-20 17:40:30 UTC (rev 550)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/model/manager/impl/NameServerManagerImpl.java	2016-02-22 04:49:24 UTC (rev 551)
@@ -20,6 +20,8 @@
 
 import org.eclipse.emf.ecore.EClass;
 import org.omg.CosNaming.NamingContextExt;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <!-- begin-user-doc -->
@@ -32,6 +34,9 @@
  */
 public class NameServerManagerImpl extends NodeImpl implements NameServerManager {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(NameServerManagerImpl.class);
+
 	/**
 	 * ネームサーバのシングルトンインスタンス
 	 */
@@ -182,7 +187,7 @@
 					try {
 						synchronizeAll();
 					} catch (Exception e) {
-						e.printStackTrace();
+						LOGGER.error("Fail to synchronize all.", e);
 					}
 				}
 			};

Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/dialog/NameServerSectionsDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/dialog/NameServerSectionsDialog.java	2016-02-20 17:40:30 UTC (rev 550)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/dialog/NameServerSectionsDialog.java	2016-02-22 04:49:24 UTC (rev 551)
@@ -24,6 +24,8 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * ネームサーバを追加するダイアログ
@@ -31,6 +33,10 @@
  * コンボボックスには、接続が成功したことのあるアドレスの一覧が表示され、最後に接続したアドレスが選択される。
  */
 public class NameServerSectionsDialog extends Dialog {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(NameServerSectionsDialog.class);
+
 	private enum AddStatus{SUCCESS, CANT_CONNECT, CANT_CREATE_OBJECT_TREE, ALREADY_CONNECT}
 
 	/**
@@ -212,9 +218,9 @@
 		try {
 			dialog.run(false, false, runable);
 		} catch (InvocationTargetException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail in dialog (invocation)", e);
 		} catch (InterruptedException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail in dialog (interrupted", e);
 		}
 
 		if (runable.getResult() == AddStatus.CANT_CONNECT) {
@@ -269,7 +275,7 @@
 			} catch (AlreadyExistException e) {
 				result = AddStatus.ALREADY_CONNECT;
 			} catch (Exception e) {
-				e.printStackTrace();
+				LOGGER.error("Fail to add nameserver. value=" + this.value, e);
 			}
 			monitor.done();
 		}



More information about the openrtm-commit mailing list