/** * 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; }
/** * Returns whether currently open log is platform log or imported file. * @return true if currently open log is platform log, false otherwise */ public boolean isPlatformLogOpen() { return (fInputFile.equals(Platform.getLogFileLocation().toFile())); }
public LogView() { fLogs = new ArrayList(); fInputFile = Platform.getLogFileLocation().toFile(); }
/** * Constructor */ public LogView() { elements = new ArrayList(); groups = new HashMap(); batchedEntries = new ArrayList(); fInputFile = Platform.getLogFileLocation().toFile(); }
public void run() { fInputFile = Platform.getLogFileLocation().toFile(); reloadLog(); } };
/** * */ public void setPlatformLog() { setLogFile(Platform.getLogFileLocation().toFile()); } }
public void run() { fInputFile = Platform.getLogFileLocation().toFile(); reloadLog(); } };
public void logging(IStatus status, String plugin) { if (!fInputFile.equals(Platform.getLogFileLocation().toFile())) return; if (fFirstEvent) { readLogFile(); asyncRefresh(); fFirstEvent = false; } else { pushStatus(status); } }
@Override public void createPageButtons(Composite parent) { Button button = createButton(parent, BROWSE_ERROR_LOG_BUTTON, WorkbenchMessages.AboutSystemDialog_browseErrorLogName); String filename = Platform.getLogFileLocation().toOSString(); button.setEnabled(new File(filename).exists()); createButton(parent, COPY_TO_CLIPBOARD_BUTTON, WorkbenchMessages.AboutSystemDialog_copyToClipboardName); }
private Action createDeleteLogAction() { Action action = new Action(PDERuntimeMessages.LogView_delete) { public void run() { doDeleteLog(); } }; action.setToolTipText(PDERuntimeMessages.LogView_delete_tooltip); action.setImageDescriptor(PDERuntimePluginImages.DESC_REMOVE_LOG); action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_REMOVE_LOG_DISABLED); action.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); return action; }
final String filename = Platform.getLogFileLocation().toOSString(); final File log = new File(filename); if (!log.exists()) {
private Action createDeleteLogAction() { Action action = new Action(Messages.LogView_delete) { public void run() { doDeleteLog(); } }; action.setToolTipText(Messages.LogView_delete_tooltip); action.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.DESC_REMOVE_LOG)); action.setDisabledImageDescriptor(SharedImages.getImageDescriptor(SharedImages.DESC_REMOVE_LOG_DISABLED)); action.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); return action; }
public void run() { if (!fTree.isDisposed()) { fTreeViewer.refresh(); fDeleteLogAction.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); fOpenLogAction.setEnabled(fInputFile.exists()); fExportAction.setEnabled(fInputFile.exists()); if (activate && fActivateViewAction.isChecked()) { IWorkbenchPage page = PDERuntimePlugin.getActivePage(); if (page != null) page.bringToTop(view); } } } });
public static void openErrorLogBrowser(Shell shell) { String filename = Platform.getLogFileLocation().toOSString();
/** * 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 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() + ')'; ServiceReference[] references; FrameworkLog perfLog = null; try { references = context.getServiceReferences(FrameworkLog.class.getName(), filter); if (references != null && references.length > 0) { //just take the first matching service perfLog = (FrameworkLog) context.getService(references[0]); //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 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() + ')'; ServiceReference[] references; FrameworkLog perfLog = null; try { references = context.getServiceReferences(FrameworkLog.class.getName(), filter); if (references != null && references.length > 0) { //just take the first matching service perfLog = (FrameworkLog) context.getService(references[0]); //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 = new PlatformLogWriter(perfLog); }
public void run() { if (!fTree.isDisposed()) { TreeViewer viewer = fFilteredTree.getViewer(); viewer.refresh(); viewer.expandToLevel(2); fDeleteLogAction.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); fOpenLogAction.setEnabled(fInputFile.exists()); fExportLogAction.setEnabled(fInputFile.exists()); fExportLogEntryAction.setEnabled(!viewer.getSelection().isEmpty()); if (activate && fActivateViewAction.isChecked()) { IWorkbenchWindow window = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow(); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { page.bringToTop(view); } } } } } });
ImportConfigurationLogAction importWorkspaceLogAction = new ImportConfigurationLogAction(Messages.ImportLogAction_reloadWorkspaceLog, Platform.getLogFileLocation().toFile().getAbsolutePath()) {