/** * Logs performance event failures to the platform's performance log */ private void logFailure(PerformanceStats stats, String pluginId, long elapsed) { //may have failed to get the performance log service if (log == null) return; if (pluginId == null) pluginId = Platform.PI_RUNTIME; String msg = "Performance failure: " + stats.getEvent() + " blame: " + stats.getBlameString() + " context: " + stats.getContext() + " duration: " + elapsed; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ Status status = new Status(IStatus.WARNING, pluginId, 1, msg, new RuntimeException()); log.log(new FrameworkLogEntry(status, status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), 0, status.getException(), null)); }
/** * Private constructor to enforce singleton usage. */ private PerformanceStatsProcessor() { super("Performance Stats"); //$NON-NLS-1$ setSystem(true); setPriority(DECORATE); BundleContext context = PlatformActivator.getContext(); String filter = '(' + FrameworkLog.SERVICE_PERFORMANCE + '=' + Boolean.TRUE.toString() + ')'; Collection<ServiceReference<FrameworkLog>> references; FrameworkLog perfLog = null; try { references = context.getServiceReferences(FrameworkLog.class, filter); if (references != null && !references.isEmpty()) { //just take the first matching service perfLog = context.getService(references.iterator().next()); //make sure correct location is set IPath logLocation = Platform.getLogFileLocation(); logLocation = logLocation.removeLastSegments(1).append("performance.log"); //$NON-NLS-1$ perfLog.setFile(logLocation.toFile(), false); } } catch (Exception e) { IStatus error = new Status(IStatus.ERROR, Platform.PI_RUNTIME, 1, "Error loading performance log", e); //$NON-NLS-1$ InternalPlatform.getDefault().log(error); } //use the platform log if we couldn't create the performance log if (perfLog == null) perfLog = InternalPlatform.getDefault().getFrameworkLog(); log = perfLog; }
private static void logToFWLog(String bsn, int level, String message, Throwable t) { int severity = FrameworkLogEntry.INFO; switch (level) { case LogService.LOG_ERROR : severity = FrameworkLogEntry.ERROR; break; case LogService.LOG_WARNING : severity = FrameworkLogEntry.WARNING; break; case LogService.LOG_INFO : severity = FrameworkLogEntry.INFO; break; case LogService.LOG_DEBUG : severity = FrameworkLogEntry.INFO; break; } fwLog.log(new FrameworkLogEntry(bsn, severity, 0, message, 0, t, null)); }
static public void log(String msg, int severity, Throwable e) { FrameworkLog log = logTracker == null ? null : logTracker.getService(); if (log != null) { FrameworkLogEntry logEntry = new FrameworkLogEntry(plugin_name, severity, 0, msg, 0, e, null); log.log(logEntry); } } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
public void log(String entry, int severity, String message, Throwable throwable, FrameworkLogEntry[] children) { getFrameworkLog().log(new FrameworkLogEntry(entry, severity, 0, message, 0, throwable, children)); } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private void internalError(String elementName) { FrameworkLogEntry error; String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_PARSE_UNKNOWNTOP_ELEMENT, elementName); error = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, (manifestInfo.pluginId == null ? message : "Plug-in : " + manifestInfo.pluginId + ", " + message), 0, null, null); //$NON-NLS-1$ //$NON-NLS-2$ adaptor.getFrameworkLog().log(error); }
static public void log(String msg, int severity, Throwable e) { FrameworkLog log = DIActivator.getDefault().getFrameworkLog(); FrameworkLogEntry logEntry = new FrameworkLogEntry(plugin_name, severity, 0, msg, 0, e, null); log.log(logEntry); } }
public BaseData[] getInstalledBundles() { try { return readBundleDatas(); } catch (Throwable t) { // be safe here and throw out the results and start over // otherwise this would result in a failed launch FrameworkLogEntry logEntry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, "Error loading bundle datas. Recalculating cache.", 0, t, null); //$NON-NLS-1$ adaptor.getFrameworkLog().log(logEntry); return null; } }