]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed Simantics Console activation and formatted message output 54/3754/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 30 Dec 2019 13:54:22 +0000 (15:54 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 30 Dec 2019 13:54:22 +0000 (15:54 +0200)
Also fixed an NPE from org.simantics.platform.ui.internal.Activator.stop

gitlab #437

Change-Id: I83e5d08d49ee0f97ac6c81987054ffa01b916516

bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/SimanticsConsole.java
bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/Activator.java
bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/ConsoleAppender.java

index c7aa2e1856e4af45785e1250abe99404eb318b26..3660968578641dc3464d428fe8dbdea5ebe5dab9 100644 (file)
@@ -114,6 +114,7 @@ public class SimanticsConsole extends MessageConsole {
 
         SimanticsConsole sc = new SimanticsConsole();
         ConsolePlugin.getDefault().getConsoleManager().addConsoles(new SimanticsConsole[] {sc});
 
         SimanticsConsole sc = new SimanticsConsole();
         ConsolePlugin.getDefault().getConsoleManager().addConsoles(new SimanticsConsole[] {sc});
+        sc.activate();
         return sc;
 
     }
         return sc;
 
     }
index bd910dd27d13fd98717bef339e9993202a28043a..f7047f1a1e18a56c02ad9014f6eb7e7a97943aac 100644 (file)
@@ -10,6 +10,7 @@
  *     Semantum Oy - initial API and implementation
  *******************************************************************************/
 package org.simantics.platform.ui.internal;
  *     Semantum Oy - initial API and implementation
  *******************************************************************************/
 package org.simantics.platform.ui.internal;
+
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
@@ -40,7 +41,7 @@ public class Activator extends AbstractUIPlugin {
 
     @Override
     public void stop(BundleContext context) throws Exception {
 
     @Override
     public void stop(BundleContext context) throws Exception {
-        context = null;
+        this.context = null;
         super.stop(context);
     }
 
         super.stop(context);
     }
 
index 8c3bf370563131f52eff0b8f42f42d4312e09590..62f90a529a9a804c660741eb122e908980d2a53f 100644 (file)
@@ -40,7 +40,7 @@ public class ConsoleAppender extends AppenderBase<ILoggingEvent> {
         b.append('[');
         b.append(formatter.format(new Date(e.getTimeStamp())));
         b.append("]: ");
         b.append('[');
         b.append(formatter.format(new Date(e.getTimeStamp())));
         b.append("]: ");
-        b.append(e.getMessage());
+        b.append(e.getFormattedMessage());
         console.write(b.toString());
     }
     
         console.write(b.toString());
     }