public void log(int level, String message, Throwable exception) { doLog(null, level, message, exception); }
public void log(int level, String message) { log(null, level, message, null); }
synchronized LogService getLogService() { if (context == null) { if (logService == null) logService = new SystemLogService(PLUGIN_ID); return logService; } if (logServiceTracker == null) { logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null); logServiceTracker.open(); } logService = (LogService) logServiceTracker.getService(); if (logService == null) logService = new SystemLogService(PLUGIN_ID); return logService; }
private final void doLog(ServiceReference sr, int level, String message, Throwable t) { final StringBuffer buf = new StringBuffer("[log;"); //$NON-NLS-1$ buf.append(dateFormat.format(new Date())).append(";"); //$NON-NLS-1$ buf.append(getLogCode(level)).append(";"); //$NON-NLS-1$ if (sr != null) buf.append(sr.getBundle().getSymbolicName()).append(";"); //$NON-NLS-1$ else buf.append(pluginName).append(";"); //$NON-NLS-1$ buf.append(message).append("]"); //$NON-NLS-1$ if (t != null) { System.err.println(buf.toString()); t.printStackTrace(System.err); } else System.out.println(buf.toString()); }
protected LogService getLogService() { if (context == null) { if (systemLogService == null) systemLogService = new SystemLogService(PLUGIN_ID); return systemLogService; } if (logServiceTracker == null) { logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null); logServiceTracker.open(); } logService = (LogService) logServiceTracker.getService(); if (logService == null) logService = new SystemLogService(PLUGIN_ID); return logService; }
private final void doLog(@SuppressWarnings("rawtypes") ServiceReference sr, int level, String message, Throwable t) { final StringBuffer buf = new StringBuffer("[log;"); //$NON-NLS-1$ buf.append(dateFormat.format(new Date())).append(";"); //$NON-NLS-1$ buf.append(getLogCode(level)).append(";"); //$NON-NLS-1$ if (sr != null) buf.append(sr.getBundle().getSymbolicName()).append(";"); //$NON-NLS-1$ else buf.append(pluginName).append(";"); //$NON-NLS-1$ buf.append(message).append("]"); //$NON-NLS-1$ if (t != null) { System.err.println(buf.toString()); t.printStackTrace(System.err); } else System.out.println(buf.toString()); }
@SuppressWarnings({ "rawtypes", "unchecked" }) synchronized LogService getLogService() { if (context == null) { if (logService == null) logService = new SystemLogService(PLUGIN_ID); return logService; } if (logServiceTracker == null) { logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null); logServiceTracker.open(); } logService = (LogService) logServiceTracker.getService(); if (logService == null) logService = new SystemLogService(PLUGIN_ID); return logService; }
public void log(ServiceReference sr, int level, String message, Throwable exception) { doLog(sr, level, message, exception); }
public void log(int level, String message) { log(null, level, message, null); }
public void log(@SuppressWarnings("rawtypes") ServiceReference sr, int level, String message, Throwable exception) { doLog(sr, level, message, exception); }
public void log(ServiceReference sr, int level, String message) { log(sr, level, message, null); }
public void log(int level, String message, Throwable exception) { doLog(null, level, message, exception); }
public void log(@SuppressWarnings("rawtypes") ServiceReference sr, int level, String message) { log(sr, level, message, null); }