Author: dgeraskov
Date: 2008-08-27 04:42:27 -0400 (Wed, 27 Aug 2008)
New Revision: 9916
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/HibernateJptUIPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2658
logging
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/HibernateJptUIPlugin.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/HibernateJptUIPlugin.java 2008-08-27
07:56:48 UTC (rev 9915)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/HibernateJptUIPlugin.java 2008-08-27
08:42:27 UTC (rev 9916)
@@ -11,6 +11,8 @@
package org.jboss.tools.hibernate.jpt.ui;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -62,8 +64,42 @@
* Log message
*
*/
- public static void log(int severity, String message) {
- //not realized
+ private static void log(int severity, String message, Throwable e) {
+ getDefault().getLog().log(new Status(severity, PLUGIN_ID, message, e));
}
+
+ /**
+ * Short exception log
+ *
+ */
+ public static void logException(Throwable e) {
+ log(IStatus.ERROR, e.getMessage(), e);
+ }
+
+ /**
+ * Short error log call
+ *
+ */
+ public static void logError(String message) {
+ log(IStatus.ERROR, message, null);
+ }
+
+ /**
+ * Short warning log call
+ *
+ */
+ public static void logWarning(String message) {
+ log(IStatus.WARNING, message, null);
+ }
+
+ /**
+ * Short information log call
+ *
+ */
+ public static void logInfo(String message) {
+ log(IStatus.INFO, message, null);
+ }
+
+
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-08-27
07:56:48 UTC (rev 9915)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-08-27
08:42:27 UTC (rev 9916)
@@ -35,6 +35,7 @@
import org.eclipse.jpt.gen.internal.PackageGenerator;
import org.eclipse.jpt.ui.internal.platform.generic.GenericPlatformUi;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
import org.jboss.tools.hibernate.jpt.ui.wizard.GenerateDdlWizard;
import org.jboss.tools.hibernate.jpt.ui.wizard.GenerateEntitiesWizard;
@@ -79,7 +80,7 @@
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, exporters);
wc.setAttribute(full_exporter_id, true);
} catch (CoreException e) {
- e.printStackTrace();
+ HibernateJptUIPlugin.logException(e);
}
return wc;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2008-08-27
07:56:48 UTC (rev 9915)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2008-08-27
08:42:27 UTC (rev 9916)
@@ -26,6 +26,7 @@
import org.eclipse.jpt.ui.internal.JptUiMessages;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
import org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernatePlatformUI;
/**
@@ -79,7 +80,7 @@
try {
wc.launch(ILaunchManager.RUN_MODE, null);
} catch (CoreException e) {
- e.printStackTrace();
+ HibernateJptUIPlugin.logException(e);
} finally{
if (initPage.isTemporaryConfiguration()){
KnownConfigurations.getInstance().removeConfiguration(KnownConfigurations.getInstance().find(concoleConfigurationName),
false);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2008-08-27
07:56:48 UTC (rev 9915)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2008-08-27
08:42:27 UTC (rev 9916)
@@ -32,6 +32,7 @@
import org.eclipse.jpt.utility.internal.CollectionTools;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
import org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernatePlatformUI;
/**
@@ -91,7 +92,7 @@
try {
wc.launch(ILaunchManager.RUN_MODE, null);
} catch (CoreException e) {
- e.printStackTrace();
+ HibernateJptUIPlugin.logException(e);
} finally{
if (initPage.isTemporaryConfiguration()){
KnownConfigurations.getInstance().removeConfiguration(KnownConfigurations.getInstance().find(concoleConfigurationName),
false);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-08-27
07:56:48 UTC (rev 9915)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-08-27
08:42:27 UTC (rev 9916)
@@ -58,6 +58,7 @@
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.hibernate.util.StringHelper;
+import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
import org.w3c.dom.Element;
/**
@@ -258,8 +259,7 @@
wc.doSave();
return wc.getName();
} catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ HibernateJptUIPlugin.logException(e);
return null;
}