1 11 package org.eclipse.ui.internal.part.services; 12 13 import org.eclipse.core.runtime.ILog; 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.core.runtime.Platform; 16 import org.eclipse.ui.internal.part.components.services.IStatusFactory; 17 import org.eclipse.ui.internal.part.components.services.ISystemLog; 18 import org.osgi.framework.Bundle; 19 20 23 public class SystemLog implements ISystemLog { 24 25 private IStatusFactory factory; 26 private Bundle pluginBundle; 27 28 public SystemLog(Bundle pluginBundle, IStatusFactory factory) { 29 this.pluginBundle = pluginBundle; 30 this.factory = factory; 31 } 32 33 36 public void log(IStatus toLog) { 37 ILog log = Platform.getLog(pluginBundle); 38 if (log != null) { 39 log.log(toLog); 40 } 41 } 42 43 46 public void log(Throwable t) { 47 log(factory.newError(t)); 48 } 49 50 } 51 | Popular Tags |