org.simantics.browsing.ui.model;bundle-version="1.0.0",
org.simantics.modeling.ui;bundle-version="1.1.1",
org.simantics.graph.db;bundle-version="1.1.9",
- org.simantics.views.swt.client;bundle-version="1.0.0"
+ org.simantics.views.swt.client;bundle-version="1.0.0",
+ org.slf4j.api;bundle-version="1.7.20"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: VTT Technical Research Centre of Finland
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.UnaryRead;\r
import org.simantics.db.common.request.WriteRequest;\r
-import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.util.Layer0Utils;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.utils.ui.ISelectionUtils;\r
import org.simantics.views.swt.client.base.ISWTViewNode;\r
import org.simantics.views.swt.client.impl.SWTExplorer;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
import gnu.trove.map.hash.THashMap;\r
import gnu.trove.set.hash.THashSet;\r
* @author Tuukka Lehtonen\r
*/\r
public class SCL {\r
+ \r
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCL.class);\r
\r
final public static String EMPTY = "";\r
final public static String MAPPED = "Mapped";\r
try {\r
doAdd((Variable)properties.input);\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("newAnnotationModifier failed", e);\r
}\r
return null;\r
\r
String name = graph.getPossibleRelatedValue(r, L0.HasName, Bindings.STRING);\r
if(name != null) {\r
if (result.put(name, r) != null)\r
- System.err.println(this + ": The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() +").");\r
+ LOGGER.error("The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() +").");\r
}\r
}\r
return result;\r
org.simantics.scl.runtime;bundle-version="0.1.4",
org.simantics.user.ontology;bundle-version="1.0.0",
org.simantics.layer0x.ontology;bundle-version="1.0.0",
- org.simantics.issues.ontology;bundle-version="1.2.0"
+ org.simantics.issues.ontology;bundle-version="1.2.0",
+ org.slf4j.api
Export-Package: org.simantics.db.common,
org.simantics.db.common.adaption,
org.simantics.db.common.auth,
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class PropertyMapOfResource extends ResourceRead<Map<String, Resource>> {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(PropertyMapOfResource.class);\r
+\r
public PropertyMapOfResource(Resource resource) {\r
super(resource);\r
}\r
if(name != null) {\r
String escapedName = URIStringUtils.escape(name); \r
if (result.put(escapedName, predicate) != null)\r
- System.err.println(this + ": The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() +").");\r
+ LOGGER.error("The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() +").");\r
}\r
} \r
}\r
import org.simantics.db.common.ProcedureBarrier;\r
import org.simantics.db.common.WriteBindings;\r
import org.simantics.db.common.procedure.adapter.AsyncMultiProcedureAdapter;\r
+import org.simantics.db.common.request.PropertyMapOfResource;\r
import org.simantics.db.common.request.ResourceAsyncRead;\r
import org.simantics.db.procedure.AsyncProcedure;\r
import org.simantics.layer0.Layer0;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class EscapedChildMapOfResource extends ResourceAsyncRead<Map<String, Resource>> {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(EscapedChildMapOfResource.class);\r
+\r
public EscapedChildMapOfResource(Resource resource) {\r
super(resource);\r
}\r
if (name != null) {\r
String escapedName = URIStringUtils.escape((String)name); \r
if (map.put(escapedName, child) != null)\r
- System.err.println(this + ": The database contains siblings with the same name " + escapedName + " (resource=" + resource.getResourceId() +").");\r
+ LOGGER.error("The database contains siblings with the same name " + escapedName + " (resource=" + resource.getResourceId() +").");\r
}\r
barrier.dec(g, procedure, map);\r
}\r
import org.simantics.db.service.CollectionSupport;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.utils.Development;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class UnescapedChildMapOfResource extends ResourceRead<Map<String, Resource>> {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(UnescapedChildMapOfResource.class);\r
+\r
public UnescapedChildMapOfResource(Resource resource) {\r
super(resource);\r
}\r
if(name != null) {\r
Resource old = result.put(name, r);\r
if (old != null)\r
- System.err.println(this + ": The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ", previous child=$" + old.getResourceId() + ").");\r
+ LOGGER.error("The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ", previous child=$" + old.getResourceId() + ").");\r
} else {\r
if(Development.DEVELOPMENT)\r
- System.err.println(this + ": The database contains a child with no unique name (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ").");\r
+ LOGGER.error("The database contains a child with no unique name (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ").");\r
}\r
}\r
return result;\r
org.simantics.document.base.ontology;bundle-version="1.1.0",
org.simantics.modeling;bundle-version="1.1.1",
org.simantics.document.server.io;visibility:=reexport,
- org.simantics.scl.db;bundle-version="0.1.3"
+ org.simantics.scl.db;bundle-version="0.1.3",
+ org.slf4j.api
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.simantics.document.server.Activator
Export-Package: org.simantics.document.server,
\r
import java.util.List;\r
\r
-import org.simantics.Logger;\r
import org.simantics.db.procedure.Listener;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class DocumentHistoryListener implements Listener<List<JSONObject>> {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(DocumentHistoryListener.class);\r
\r
final private DocumentHistory history;\r
\r
\r
@Override\r
public void exception(Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.warn("DocumentHistoryListener received an exception.", t);\r
}\r
\r
@Override\r
import java.io.PrintStream;\r
import java.io.UnsupportedEncodingException;\r
\r
-import org.simantics.Logger;\r
import org.simantics.db.layer0.exception.MissingVariableException;\r
import org.simantics.db.layer0.scl.SCLDatabaseException;\r
import org.simantics.document.server.DocumentException;\r
import org.simantics.scl.compiler.module.repository.ImportFailure;\r
import org.simantics.scl.compiler.module.repository.ImportFailureException;\r
import org.simantics.scl.compiler.top.NotFoundException;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class NodeRequestUtils {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(NodeRequestUtils.class);\r
\r
public static String formatErrorMessage(String name, Throwable t) {\r
\r
sb.append(" " + f.moduleName + "\n");\r
return sb.toString();\r
} else {\r
- Logger.defaultLogError(t);\r
- \r
+ LOGGER.error("Node request error:", t);\r
+ \r
ByteArrayOutputStream baos = new ByteArrayOutputStream();\r
PrintStream ps = new PrintStream(baos);\r
t.printStackTrace(ps);\r
org.simantics.utils.ui;bundle-version="1.1.0",
org.simantics.graph.db;bundle-version="1.1.9",
org.simantics;bundle-version="1.0.0",
- com.lowagie.text;bundle-version="2.1.7";resolution:=optional
+ com.lowagie.text;bundle-version="2.1.7";resolution:=optional,
+ org.slf4j.api
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.simantics.export.core,
org.simantics.export.core.error,
import org.osgi.framework.BundleContext;\r
import org.osgi.framework.InvalidSyntaxException;\r
import org.osgi.framework.ServiceReference;\r
-import org.simantics.Logger;\r
import org.simantics.export.core.internal.Activator;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
import com.lowagie.text.Document;\r
import com.lowagie.text.Paragraph;\r
* @since 1.22.2\r
*/\r
public class ServiceBasedPdfExportPageEvent extends PdfPageEventHelper {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServiceBasedPdfExportPageEvent.class);\r
\r
Map<String, PdfExportPageEvent> events;\r
\r
try {\r
r.accept(event);\r
} catch (Exception e) {\r
- Logger.defaultLogError("Failed to invoke PdfExportPageEvent::" + eventName + " for " + event.toString(), e);\r
+ LOGGER.error("Failed to invoke PdfExportPageEvent::" + eventName + " for " + event.toString(), e);\r
}\r
}\r
\r
org.eclipse.ui.editors;bundle-version="3.9.0",
org.eclipse.jface.text;bundle-version="3.10.0",
org.eclipse.core.resources;bundle-version="3.10.1",
- org.simantics.help.core
+ org.simantics.help.core,
+ org.slf4j.api
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
\r
import org.eclipse.ui.PartInitException;\r
import org.eclipse.ui.PlatformUI;\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.ui.workbench.ResourceEditorInput2;\r
import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class OpenHelpFileAdapter extends AbstractResourceEditorAdapter {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(OpenHelpFileAdapter.class);\r
\r
public OpenHelpFileAdapter() {\r
super("Help File Editor");\r
String editorId = getEditorId();\r
WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, input, model, rvi));\r
} catch (PartInitException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Failed to open an editor for help file.", e);\r
}\r
}\r
});\r
org.simantics.layer0.utils;bundle-version="0.6.2",
org.simantics.db.services;bundle-version="0.6.2",
org.simantics;bundle-version="1.0.0",
- org.simantics.issues.ui.ontology;bundle-version="1.0.0"
+ org.simantics.issues.ui.ontology;bundle-version="1.0.0",
+ org.slf4j.api
Export-Package: org.simantics.issues.common,
org.simantics.issues.common.preferences
Bundle-Vendor: VTT Technical Research Centre of Finland
import java.util.List;\r
import java.util.Set;\r
\r
-import org.simantics.Logger;\r
import org.simantics.db.Issue;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.issues.ontology.IssueResource;\r
import org.simantics.layer0.Layer0;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class DependencyIssueValidator2 extends ResourceRead3<Boolean> {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(DependencyIssueValidator2.class);\r
\r
public static final boolean DEBUG = false;\r
\r
if(DEBUG) System.err.println("Validator found: " + contexts.size() + " issues (" + contexts + ")");\r
return contexts;\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Reading a constraint validator failed", e);\r
return Collections.emptySet();\r
}\r
\r
import java.util.UUID;\r
import java.util.concurrent.atomic.AtomicBoolean;\r
\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.databoard.util.URIStringUtils;\r
import org.simantics.operation.Layer0X;\r
import org.simantics.scl.runtime.function.FunctionImpl2;\r
import org.simantics.utils.datastructures.Pair;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
/**\r
* @author Tuukka Lehtonen\r
*/\r
public class IssueUtils {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(IssueUtils.class);\r
\r
public static Resource toSeverityResource(IssueResource ISSUE, Severity severity) {\r
switch (severity) {\r
});\r
}\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Updating issue source failed.", e);\r
}\r
} else {\r
Session session = Simantics.getSession();\r
\r
@Override\r
public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException {\r
- Logger.defaultLogError(throwable);\r
+ LOGGER.error("IssueValidityListener received an exception.", throwable);\r
}\r
\r
}\r
\r
@Override\r
public void exception(ReadGraph graph, Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.error("IssueSourceManagedIssuesListener received an exception.", t);\r
}\r
\r
@Override\r
\r
@Override\r
public void exception(ReadGraph graph, Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.error("ActiveIssueSourceListener received an exception.", t);\r
}\r
\r
@Override\r
org.simantics.db.layer0,
org.simantics.silk.ontology;bundle-version="1.1.0",
org.simantics.image.ui;bundle-version="1.0.0",
- org.simantics.export.core;bundle-version="1.0.0"
+ org.simantics.export.core;bundle-version="1.0.0",
+ org.slf4j.api
Export-Package: org.simantics.modeling.ui,
org.simantics.modeling.ui.actions,
org.simantics.modeling.ui.chart.property,
import org.eclipse.jface.action.IContributionItem;\r
import org.eclipse.jface.action.MenuManager;\r
import org.eclipse.jface.action.Separator;\r
-import org.simantics.Logger;\r
import org.simantics.browsing.ui.NodeContext;\r
import org.simantics.browsing.ui.common.NodeContextBuilder;\r
import org.simantics.browsing.ui.model.InvalidContribution;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.issues.common.IssueUtils;\r
import org.simantics.modeling.ui.Activator;\r
import org.simantics.project.ontology.ProjectResource;\r
import org.simantics.ui.contribution.DynamicMenuContribution;\r
import org.simantics.ui.selection.WorkbenchSelectionElement;\r
import org.simantics.ui.selection.WorkbenchSelectionUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class ModeledActions extends DynamicMenuContribution implements IExecutableExtension {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(IssueUtils.class);\r
\r
public static final Set<String> defaultBrowseContexts = Collections.singleton(ProjectResource.URIs.ProjectActionContext);\r
\r
result.add(NodeContextBuilder.buildWithInput(res));\r
}\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Failed to get node contexts for selection.", e);\r
}\r
}\r
}\r
import org.eclipse.ui.forms.widgets.Form;\r
import org.eclipse.ui.forms.widgets.FormToolkit;\r
import org.eclipse.ui.forms.widgets.Section;\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.selectionview.SelectionViewResources;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.utils.datastructures.Pair;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class ConfigurationPropertiesSection implements ComponentTypeViewerSection {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationPropertiesSection.class);\r
+ \r
private static final String[] COLUMN_NAMES = \r
new String[] {"Name", "Type", "Default Value", "Unit", "Range", "Label", "Description"};\r
private static final int[] COLUMN_LENGTHS =\r
\r
} catch (DatabaseException e1) {\r
\r
- Logger.defaultLogError(e1);\r
+ LOGGER.error("Lifting properties failed", e1);\r
return;\r
\r
}\r
}\r
});\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Finding UserDefinedProperties failed.", e);\r
return Collections.emptyMap();\r
}\r
}\r
\r
import org.eclipse.ui.PartInitException;\r
import org.eclipse.ui.PlatformUI;\r
-import org.simantics.Logger;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.ui.workbench.ResourceEditorInput2;\r
import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class OpenSheetAdapter extends AbstractResourceEditorAdapter {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(OpenSheetAdapter.class);\r
\r
private static final String EDITOR_ID = "org.simantics.spreadsheet.ui.editor2";\r
\r
String editorId = getEditorId();\r
WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, r, model, rvi));\r
} catch (PartInitException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Failed to open the spreadsheet editor.", e);\r
}\r
}\r
});\r
*******************************************************************************/\r
package org.simantics.modeling.ui.diagramEditor;\r
\r
-import gnu.trove.set.hash.THashSet;\r
-\r
import java.awt.datatransfer.Transferable;\r
import java.awt.datatransfer.UnsupportedFlavorException;\r
import java.awt.dnd.DnDConstants;\r
import java.util.List;\r
\r
import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.simantics.Logger;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.RequestProcessor;\r
import org.simantics.db.Resource;\r
import org.simantics.utils.datastructures.Triple;\r
import org.simantics.utils.datastructures.hints.IHintContext;\r
import org.simantics.utils.ui.ISelectionUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import gnu.trove.set.hash.THashSet;\r
\r
public class PopulateElementMonitorDropParticipant extends PopulateElementDropParticipant implements IDropTargetParticipant {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(PopulateElementMonitorDropParticipant.class);\r
\r
private static final boolean DEBUG = false;\r
\r
dp.getHints().setHint(DnDHints.KEY_DND_GRID_COLUMNS, Integer.valueOf(1));\r
}\r
\r
- } catch (UnsupportedFlavorException e) {\r
- Logger.defaultLogError(e);\r
- } catch (IOException e) {\r
- Logger.defaultLogError(e);\r
- } catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ } catch (UnsupportedFlavorException|IOException|DatabaseException e) {\r
+ LOGGER.error("dragEnter failed", e);\r
}\r
-\r
}\r
\r
dtde.acceptDrag(DnDConstants.ACTION_COPY);\r
org.simantics.scenegraph.profile;bundle-version="1.0.0",
org.simantics.scl.db;bundle-version="0.1.3",
org.simantics.selectionview.ontology;bundle-version="1.2.0",
- org.simantics.scl.ui;bundle-version="0.5.0"
+ org.simantics.scl.ui;bundle-version="0.5.0",
+ org.slf4j.api
Export-Package: org.simantics.modeling,
org.simantics.modeling.actions,
org.simantics.modeling.adapters,
import org.eclipse.core.runtime.jobs.IJobManager;\r
import org.eclipse.core.runtime.jobs.Job;\r
import org.simantics.DatabaseJob;\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.SimanticsPlatform;\r
import org.simantics.SimanticsPlatform.OntologyRecoveryPolicy;\r
import org.simantics.db.layer0.util.RemoverUtil;\r
import org.simantics.db.layer0.util.SimanticsClipboard;\r
import org.simantics.db.service.DebugSupport;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class SCL {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCL.class);\r
+\r
public static void killPlatformWrite(WriteGraph graph) throws DatabaseException {\r
// Currently not supported.\r
// Would be relatively easy to support the desired functionality.\r
try {\r
Thread.sleep(ms);\r
} catch (InterruptedException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.warn("Sleep was interrupted.", e);\r
}\r
}\r
\r
package org.simantics.modeling.scl;\r
\r
-import gnu.trove.map.hash.THashMap;\r
-\r
import java.io.IOException;\r
import java.util.Map;\r
import java.util.concurrent.ExecutorService;\r
import java.util.concurrent.ThreadPoolExecutor;\r
import java.util.concurrent.TimeUnit;\r
\r
-import org.simantics.Logger;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.databoard.binding.Binding;\r
import org.simantics.databoard.binding.mutable.Variant;\r
import org.simantics.scl.runtime.tuple.Tuple0;\r
import org.simantics.simulator.variable.NodeManager;\r
import org.simantics.simulator.variable.Realm;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
\r
public class SCLRealm implements Realm {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCLRealm.class);\r
+\r
public static final String SCL = "scl";\r
\r
THashMap<String,Type> contextTypes = new THashMap<String,Type>();\r
try {\r
runnable.run();\r
} catch (Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.error("Runnable failed in syncExec.", t);\r
} finally {\r
}\r
return;\r
try {\r
runnable.run();\r
} catch (Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.error("Runnable failed in syncExec.", t);\r
} finally {\r
executorThread = oldThread;\r
endSyncExec.release();\r
try {\r
runnable.run();\r
} catch (Throwable t) {\r
- Logger.defaultLogError(t);\r
+ LOGGER.error("Runnable failed in asyncExec.", t);\r
} finally {\r
}\r
return;\r
import java.util.Set;\r
\r
import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.utils.strings.AlphanumComparator;\r
import org.simantics.utils.strings.EString;\r
import org.simantics.utils.ui.ErrorLogger;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
import gnu.trove.map.hash.THashMap;\r
import gnu.trove.set.hash.THashSet;\r
* @see TypicalSynchronizationMetadata\r
*/\r
public class SyncTypicalTemplatesToInstances extends WriteRequest {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(SyncTypicalTemplatesToInstances.class);\r
\r
/**\r
* A constant used as the second argument to\r
syncInstance(graph, template, instance, templateElements);\r
}\r
} catch (Exception e) {\r
- Logger.defaultLogError(e);\r
- e.printStackTrace();\r
+ LOGGER.error("Template synchronization failed.", e);\r
} finally {\r
this.temporaryDiagram.removeHint(DiagramModelHints.KEY_DIAGRAM_RESOURCE);\r
}\r
org.eclipse.equinox.p2.touchpoint.natives;bundle-version="1.0.200",
org.eclipse.equinox.p2.transport.ecf;bundle-version="1.0.0",
org.simantics.graph.db;bundle-version="1.0.0",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.db.procore;bundle-version="1.1.0",
org.eclipse.swt;bundle-version="3.6.0";resolution:=optional,
org.eclipse.core.resources;bundle-version="3.6.0";resolution:=optional,
org.simantics.graph.compiler;bundle-version="1.1.10",
- org.simantics.ltk;bundle-version="1.1.10"
+ org.simantics.ltk;bundle-version="1.1.10",
+ org.slf4j.api
Export-Package: org.eclipse.equinox.internal.p2.ui.query,
org.eclipse.equinox.internal.provisional.p2.installer,
org.simantics.project,
import java.util.Map;\r
import java.util.Properties;\r
\r
-import org.apache.log4j.Logger;\r
import org.simantics.databoard.util.StreamUtil;\r
import org.simantics.db.Driver;\r
import org.simantics.db.Driver.Management;\r
import org.simantics.graph.db.CoreInitialization;\r
import org.simantics.layer0.DatabaseManagementResource;\r
import org.simantics.layer0.Layer0;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
/**\r
* Server Manager handles starting and pooling of ProCore server instances.\r
* @author Toni Kalajainen <toni.kalajainen@vtt.fi>\r
*/\r
public class ServerManager {\r
-\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServerManager.class);\r
+ \r
/** Default properties with default user and password */\r
public static final Properties DEFAULT;\r
\r
*/\r
public Session createDatabase(File databaseDirectory) throws DatabaseException {\r
try {\r
- Logger myLogger = Logger.getLogger(ServerManager.class);\r
- myLogger.debug("Creating database to "+ databaseDirectory);\r
+ LOGGER.debug("Creating database to "+ databaseDirectory);\r
\r
Session session = null;\r
ServerEx server1 = getServer(databaseDirectory);\r
if (server.isActive())\r
server.stop();\r
} catch (DatabaseException e) {\r
- Logger myLogger = Logger.getLogger(ServerManager.class);\r
- myLogger.error(e);\r
+ LOGGER.error("Failed to stop database server.", e);\r
}\r
}\r
servers.clear();\r
import java.util.zip.ZipEntry;\r
import java.util.zip.ZipInputStream;\r
\r
-import org.apache.log4j.Logger;\r
import org.simantics.db.DatabaseUserAgent;\r
import org.simantics.db.Driver;\r
import org.simantics.db.Manager;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.utils.FileUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class ServerManagerFactory {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServerManagerFactory.class);\r
+\r
public static ServerManager create(String databaseDriverId, String address) throws IOException, DatabaseException {\r
Driver driver = Manager.getDriver(databaseDriverId);\r
if (driver == null)\r
throw new IllegalArgumentException("Database driver with ID " + databaseDriverId + " could not be found!");\r
- System.out.println("ServerManagerFactory.create called with id " + databaseDriverId + ", driver is " + driver.toString());\r
+ LOGGER.info("ServerManagerFactory.create called with id {}, driver is {}.", databaseDriverId, driver);\r
DatabaseUserAgent agent = Manager.getUserAgent(databaseDriverId);\r
if (agent != null)\r
driver.setDatabaseUserAgent(address, agent);\r
* @throws IOException\r
*/\r
private static void extractZip(InputStream zipInput, File dst) throws IOException {\r
- Logger myLogger = Logger.getLogger(FileUtils.class);\r
byte[] buf = new byte[8192];\r
ZipInputStream zis = new ZipInputStream(zipInput);\r
ZipEntry entry;\r
while (entry != null) {\r
// for each entry to be extracted\r
String name = entry.getName();\r
- myLogger.debug("Extracting "+name);\r
+ LOGGER.debug("Extracting "+name);\r
File file = new File(dst, name);\r
\r
if (entry.isDirectory())\r
public abstract void collectFreeVariables(THashSet<Variable> vars);\r
\r
public Expression simplify(SimplificationContext context) {\r
- System.out.println("#############################");\r
- System.out.println(this);\r
throw new InternalCompilerError(location, getClass().getSimpleName() + " does not support simplify method.");\r
}\r
\r
type = type.replace(getTypeVariables(), typeParameters);
Expression continuation = context.getContinuation();
- System.out.println("continuation = " + continuation + " :: " + continuation.getType());
Variable set = new Variable("set", Types.apply(Types.con("MSet", "T"), type));
Variable f = new Variable("f", Types.functionE(type, Types.PROC, continuation.getType()));
Variable innerSolved = new Variable("tcTemp", solved.getType());
- System.out.println("set :: " + set.getType());
- System.out.println("f :: " + f.getType());
- System.out.println("tcTemp :: " + innerSolved.getType());
QueryCompilationContext newContext = context.createSubcontext(new EApply(
new EVariable(f), new EVariable(innerSolved)
org.simantics.scl.runtime.xml
Require-Bundle: org.junit;bundle-version="4.12.0";resolution:=optional,
gnu.trove3;bundle-version="3.0.0",
- org.simantics.databoard;bundle-version="0.6.5";visibility:=reexport
+ org.simantics.databoard;bundle-version="0.6.5";visibility:=reexport,
+ org.slf4j.api;bundle-version="1.7.20"
package org.simantics.scl.runtime.reporting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* <p>An interface that is used to handle printing commands from SCL
* such as Prelude.print. This interface is typically stored to
* @author Hannu Niemistö
*/
public interface SCLReportingHandler {
+ public static final Logger LOGGER = LoggerFactory.getLogger(SCLReportingHandler.class);
public static final String REPORTING_HANDLER = "reportingHandler";
public void print(String text);
public void didWork(double amount);
public static final SCLReportingHandler DEFAULT = new AbstractSCLReportingHandler() {
+ @Override
+ public void print(String text) {
+ LOGGER.info(text);
+ }
+
+ @Override
+ public void printError(String error) {
+ LOGGER.error(error);
+ }
+ };
+
+ public static final SCLReportingHandler DEFAULT_WITHOUT_ECHO = new AbstractSCLReportingHandler() {
+ @Override
+ public void print(String text) {
+ LOGGER.info(text);
+ }
+
+ @Override
+ public void printError(String error) {
+ LOGGER.error(error);
+ }
+
+ @Override
+ public void printCommand(String command) {
+ }
+ };
+
+ public static final SCLReportingHandler SYSOUT = new AbstractSCLReportingHandler() {
@Override
public void print(String text) {
System.out.println(text);
}
};
- public static final SCLReportingHandler DEFAULT_WITHOUT_ECHO = new AbstractSCLReportingHandler() {
+ public static final SCLReportingHandler SYSOUT_WITHOUT_ECHO = new AbstractSCLReportingHandler() {
@Override
public void print(String text) {
System.out.println(text);
org.simantics.views.ontology;bundle-version="1.0.0",
org.simantics.browsing.ui.model;bundle-version="1.0.0",
org.simantics.modeling;bundle-version="1.1.1",
- org.simantics.scenegraph.ontology;bundle-version="1.0.0"
+ org.simantics.scenegraph.ontology;bundle-version="1.0.0",
+ org.slf4j.api
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.simantics.selectionview
import java.util.HashSet;\r
import java.util.Set;\r
\r
-import org.simantics.Logger;\r
+import org.simantics.Simantics;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.ui.selection.WorkbenchSelectionUtils;\r
import org.simantics.utils.ui.ISelectionUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class StandardSelectionProcessor implements SelectionProcessor<Object, ReadGraph> {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(StandardSelectionProcessor.class);\r
\r
private static Resource getIndexRoot(ReadGraph graph, Object selection) throws DatabaseException {\r
\r
}\r
if (c.accept(graph, input))\r
c.contribute(graph, input, result);\r
- } catch (ClassCastException e) {\r
- Logger.defaultLogError(e);\r
} catch (Exception e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Selection view tab contribution failed.", e);\r
}\r
}\r
}\r
Bundle-Vendor: VTT Technical Research Centre of Finland
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.simantics.structural2.internal.Activator
+Import-Package: org.slf4j
*******************************************************************************/\r
package org.simantics.structural2.queries;\r
\r
-import gnu.trove.map.hash.THashMap;\r
-\r
import java.util.Collection;\r
import java.util.Collections;\r
import java.util.Map;\r
import org.simantics.db.layer0.request.PropertyInfo;\r
import org.simantics.db.request.RequestFlags;\r
import org.simantics.db.service.QueryControl;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
\r
public class ConnectionPointMapOfResource extends TransientResourceRead<Map<String, Resource>> {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionPointMapOfResource.class);\r
+\r
public ConnectionPointMapOfResource(ReadGraph graph, Resource resource) throws DatabaseException {\r
super(graph, resource);\r
}\r
if(info != null) {\r
if (result == null) result = new THashMap<String,Resource>(predicates.size());\r
if (result.put(info.name, predicate) != null)\r
- System.err.println(this + ": The database contains siblings with the same name " + info.name + " (resource=$" + resource.getResourceId() + ").");\r
+ LOGGER.error("The database contains siblings with the same name " + info.name + " (resource=$" + resource.getResourceId() + ").");\r
} \r
\r
}\r
org.eclipse.e4.ui.workbench,\r
org.eclipse.e4.ui.di,\r
org.eclipse.e4.ui.bindings,\r
- org.simantics.modeling.ontology;bundle-version="1.2.0"\r
+ org.simantics.modeling.ontology;bundle-version="1.2.0",\r
+ org.slf4j.api\r
Bundle-ActivationPolicy: lazy\r
Export-Package: org.simantics.ui,\r
org.simantics.ui.colors,\r
import org.eclipse.jface.resource.ImageDescriptor;\r
import org.eclipse.ui.PartInitException;\r
import org.eclipse.ui.PlatformUI;\r
-import org.simantics.Logger;\r
import org.simantics.Simantics;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
import org.simantics.ui.workbench.ResourceEditorInput2;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
public class GraphEditorAdapterDescriptor implements EditorAdapterDescriptor {\r
- \r
+ private static final Logger LOGGER = LoggerFactory.getLogger(GraphEditorAdapterDescriptor.class);\r
+\r
private final String editorId;\r
private final String label;\r
private final ImageDescriptor imageDescriptor;\r
try {\r
WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, r, model, rvi));\r
} catch (PartInitException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Failed to open the graph editor", e);\r
}\r
}\r
});\r
+++ /dev/null
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics;\r
-\r
-import java.util.Properties;\r
-\r
-import org.simantics.internal.Activator;\r
-\r
-\r
-\r
-public class Logger {\r
- public static final boolean ECHO = true;\r
- public static final Properties defaultProperties = new Properties();\r
- static {\r
- defaultProperties.put("log4j.rootCategory", "INFO, default");\r
- defaultProperties.put("log4j.appender.default", "org.apache.log4j.FileAppender");\r
- defaultProperties.put("log4j.appender.default.File", Activator.LOG_FILE_NAME);\r
- defaultProperties.put("log4j.appender.default.append", "false");\r
- defaultProperties.put("log4j.appender.default.layout", "org.apache.log4j.PatternLayout");\r
- defaultProperties.put("log4j.appender.default.layout.ConversionPattern", "%d{ISO8601} %-6r [%15.15t] %-5p %30.30c - %m%n");\r
- }\r
- private static LogManager defaultLogManager = new LogManager(defaultProperties);\r
- private static final Logger defaultErrorLogger = new Logger(LogManager.class);\r
- private org.apache.log4j.Logger logger;\r
- Logger(Class<?> clazz) {\r
- logger = defaultLogManager.getLogger(clazz);\r
- }\r
-\r
- /**\r
- * Log a trace event.\r
- * \r
- * @param message message of the trace\r
- * @param exception the exception, or <code>null</code>\r
- */\r
- public void logTrace(String message, Throwable exception) {\r
- // Errors are much more useful with a stack trace!\r
- if (exception == null) {\r
- exception = new RuntimeException();\r
- }\r
- logger.trace(message, exception);\r
- }\r
-\r
- /**\r
- * Log an info event.\r
- * \r
- * @param message message of the info\r
- * @param exception the exception, or <code>null</code>\r
- */\r
- public void logInfo(String message, Throwable exception) {\r
- // Errors are much more useful with a stack trace!\r
- if (exception == null) {\r
- exception = new RuntimeException();\r
- }\r
- logger.info(message, exception);\r
- }\r
-\r
- /**\r
- * Log a warning event.\r
- * \r
- * @param message message of the warning\r
- * @param exception the exception, or <code>null</code>\r
- */\r
- public void logWarning(String message, Throwable exception) {\r
- // Errors are much more useful with a stack trace!\r
- if (exception == null) {\r
- exception = new RuntimeException();\r
- }\r
- logger.warn(message, exception);\r
- }\r
-\r
- /**\r
- * Log an error event.\r
- * \r
- * @param message message of the error\r
- * @param exception the exception, or <code>null</code>\r
- */\r
- public void logError(String message, Throwable exception) {\r
- // Errors are much more useful with a stack trace!\r
- if (exception == null) {\r
- exception = new RuntimeException();\r
- }\r
- logger.error(message, exception);\r
- }\r
-\r
- public static Logger getDefault() {\r
- return defaultErrorLogger;\r
- }\r
- \r
- public static LogManager getDefaultLogManager() {\r
- return defaultLogManager;\r
- }\r
- public static void defaultLogError(Throwable exception) {\r
- getDefault().logError(exception.getLocalizedMessage(), exception);\r
- if(ECHO) exception.printStackTrace();\r
- }\r
- public static void defaultLogError(String message) {\r
- getDefault().logError(message, null);\r
- if(ECHO)\r
- System.err.println(message);\r
- }\r
- public static void defaultLogError(String message, Throwable exception) {\r
- getDefault().logError(message, exception);\r
- if(ECHO)\r
- System.err.println(message);\r
- }\r
- public static void defaultLogInfo(String message) {\r
- getDefault().logInfo(message, null);\r
- if(ECHO)\r
- System.err.println(message);\r
- }\r
- public static void defaultLogTrace(String message) {\r
- getDefault().logTrace(message, null);\r
- if(ECHO)\r
- System.err.println(message);\r
- }\r
- \r
-}\r
import org.simantics.utils.FileUtils;\r
import org.simantics.utils.TempFiles;\r
import org.simantics.utils.threads.ThreadUtils;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
/**\r
* A facade for accessing basic Simantics platform services. Usable without a\r
* TODO: duplicate of org.simantics.db.layer0.util.Simantics, do something about this!!\r
*/\r
public class Simantics {\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(Simantics.class);\r
\r
/**\r
* Default database driver ID\r
try {\r
IndexUtils.flushIndexCaches(progress, session);\r
} catch (Exception e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("Flushing index caches failed.", e);\r
}\r
}\r
\r
import org.simantics.utils.FileUtils;
import org.simantics.utils.datastructures.Pair;
import org.simantics.utils.logging.TimeLogger;
+import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*/
public class SimanticsPlatform implements LifecycleListener {
- private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SimanticsPlatform.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(SimanticsPlatform.class);
/**
* The policy is relevant when developing Simantics from Eclipse IDE.
});
TimeLogger.log("Flushed queries");
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("Flushing queries failed.", e);
}
boolean loadProject = true;
try {
}
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("Platform startup failed.", e);
throw new PlatformException(e);
} catch (ProjectException e) {
boolean hasStackTrace = e.getStackTrace().length > 0;
try {
Simantics.flushIndexCaches(progress.newChild(20), s);
} catch (Throwable t) {
- Logger.defaultLogError(t);
+ LOGGER.error("Failed to flush index caches.", t);
}
}
if (null != databasebManagement)
databasebManagement.shutdown();
} catch (Throwable t) {
- Logger.defaultLogError(t);
+ LOGGER.error("Database shutdown failed.", t);
}
progress.worked(10);
try {
Simantics.clearTemporaryDirectory();
} catch (Throwable t) {
- Logger.defaultLogError(t);
+ LOGGER.error("Failed to clear the temporary directory.", t);
}
progress.worked(10);
if (null != platformException)