[openrtm-commit:01724] r540 - in trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView: . repository ui/dialog ui/views
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 2月 21日 (日) 02:36:14 JST
Author: ga
Date: 2016-02-21 02:36:14 +0900 (Sun, 21 Feb 2016)
New Revision: 540
Modified:
trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/RepositoryViewPlugin.java
trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/repository/RTRepositoryAccesser.java
trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/dialog/RTRepositoryConnectDialog.java
trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/views/RepositoryView.java
Log:
Modified Logger #3211
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/RepositoryViewPlugin.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/RepositoryViewPlugin.java 2016-02-20 16:33:17 UTC (rev 539)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/RepositoryViewPlugin.java 2016-02-20 17:36:14 UTC (rev 540)
@@ -1,15 +1,20 @@
package jp.go.aist.rtm.repositoryView;
-import java.util.logging.Logger;
+import jp.go.aist.rtm.toolscommon.profiles.util.LoggerUtil;
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 RepositoryViewPlugin extends AbstractUIPlugin {
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(RepositoryViewPlugin.class);
+
// The plug-in ID
public static final String PLUGIN_ID = "jp.go.aist.rtm.repositoryView";
@@ -20,8 +25,10 @@
* The constructor
*/
public RepositoryViewPlugin() {
+ LoggerUtil.setup();
+ LOGGER.trace("RepositoryViewPlugin: START");
+
plugin = this;
- getLogger();
}
/*
@@ -50,13 +57,4 @@
return plugin;
}
- static Logger log;
-
- public static Logger getLogger() {
- if (log == null) {
- log = Logger.getLogger(PLUGIN_ID);
- }
- return log;
- }
-
}
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/repository/RTRepositoryAccesser.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/repository/RTRepositoryAccesser.java 2016-02-20 16:33:17 UTC (rev 539)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/repository/RTRepositoryAccesser.java 2016-02-20 17:36:14 UTC (rev 540)
@@ -9,15 +9,12 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import java.util.zip.CRC32;
import java.util.zip.CheckedOutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import jp.go.aist.rtm.repositoryView.RepositoryViewPlugin;
import jp.go.aist.rtm.repositoryView.model.RepositoryViewFactory;
import jp.go.aist.rtm.repositoryView.model.RepositoryViewItem;
import jp.go.aist.rtm.repositoryView.model.RepositoryViewLeafItem;
@@ -38,6 +35,8 @@
import org.openrtp.repository.RTRepositoryAccessException;
import org.openrtp.repository.RTRepositoryClient;
import org.openrtp.repository.RTRepositoryClientFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -46,7 +45,8 @@
@SuppressWarnings("restriction")
public class RTRepositoryAccesser {
- static Logger log = RepositoryViewPlugin.getLogger();
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(RTRepositoryAccesser.class);
private static final String ZIP_EXT = "ZIP"; //$NON-NLS-1$
private static final String TAR_EXT = "TAR"; //$NON-NLS-1$
@@ -100,7 +100,7 @@
try {
numberOfItems = client.countItem(itemCategory, keywords);
} catch (RTRepositoryAccessException e1) {
- log.log(Level.SEVERE, null, e1);
+ LOGGER.error("Fail to count items", e1);
return null;
}
if( cautionNumber<=numberOfItems ) {
@@ -115,7 +115,9 @@
try {
searchResults = client.searchItem(itemCategory, keywords);
} catch (RTRepositoryAccessException e) {
- e.printStackTrace();
+ LOGGER.error("Fail to search item. category=<{}>, keywords=<{}>",
+ itemCategory, keywords);
+ LOGGER.error("", e);
return null;
}
RepositoryViewItem result = createRoot(address, searchResults);
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/dialog/RTRepositoryConnectDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/dialog/RTRepositoryConnectDialog.java 2016-02-20 16:33:17 UTC (rev 539)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/dialog/RTRepositoryConnectDialog.java 2016-02-20 17:36:14 UTC (rev 540)
@@ -23,6 +23,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;
/**
* RTレポジトリへの接続ダイアログ
@@ -30,6 +32,9 @@
*/
public class RTRepositoryConnectDialog extends Dialog {
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(RTRepositoryConnectDialog.class);
+
/**
* 接続要求結果 接続に失敗したことを示す定数
*/
@@ -226,9 +231,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() == CANT_CONNECT) {
@@ -295,7 +300,7 @@
result = SUCCESS;
}
} catch (Exception e) {
- e.printStackTrace();
+ LOGGER.error("Fail to add repository value=" + this.value, e);
}
monitor.done();
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/views/RepositoryView.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/views/RepositoryView.java 2016-02-20 16:33:17 UTC (rev 539)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView/src/jp/go/aist/rtm/repositoryView/ui/views/RepositoryView.java 2016-02-20 17:36:14 UTC (rev 540)
@@ -8,13 +8,13 @@
import jp.go.aist.rtm.repositoryView.model.RTCRVLeafItem;
import jp.go.aist.rtm.repositoryView.model.RepositoryViewItem;
+import jp.go.aist.rtm.repositoryView.nl.Messages;
import jp.go.aist.rtm.repositoryView.repository.RTRepositoryAccesser;
import jp.go.aist.rtm.repositoryView.ui.ArrayContentProvider;
import jp.go.aist.rtm.repositoryView.ui.RepositoryViewLabelProvider;
import jp.go.aist.rtm.repositoryView.ui.preference.RepositoryViewPreferenceManager;
import jp.go.aist.rtm.toolscommon.model.component.ComponentSpecification;
import jp.go.aist.rtm.toolscommon.ui.views.propertysheetview.RtcPropertySheetPage;
-import jp.go.aist.rtm.repositoryView.nl.Messages;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -37,6 +37,8 @@
import org.eclipse.ui.part.DrillDownAdapter;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -45,22 +47,24 @@
*/
public class RepositoryView extends org.eclipse.ui.part.ViewPart {
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(RepositoryView.class);
+
private TreeViewer viewer;
private DrillDownAdapter drillDownAdapter;
-// private static Log Logger = LogFactory.getLog(Messages.getString("RepositoryView.0")); //$NON-NLS-1$
-
public RepositoryView() {
Properties props = System.getProperties();
try {
- String propPath = RepositoryViewPreferenceManager.getInstance().getPropertyFile_Location();
- if( !(propPath==null || propPath.equals("")) ) { //$NON-NLS-1$
+ String propPath = RepositoryViewPreferenceManager.getInstance()
+ .getPropertyFile_Location();
+ if (!(propPath == null || propPath.equals(""))) { //$NON-NLS-1$
props.load(new FileInputStream(propPath));
props.setProperty("repository.properties", propPath); //$NON-NLS-1$
}
} catch (IOException e) {
- e.printStackTrace();
+ LOGGER.error("Fail to load property", e);
}
System.setProperties(props);
//
More information about the openrtm-commit
mailing list