/** * Returns the severity level of this LogEntry object. * <p> * This is one of the severity levels defined by the * {@link org.osgi.service.logLogService} interface. * @return severity level of this LogEntry object. * @see org.osgi.service.LogService#LOG_ERROR * @see org.osgi.service.LogService#LOG_WARNING * @see org.osgi.service.LogService#LOG_INFO * @see org.osgi.service.LogService#LOG_DEBUG */ public int getLevel() { if (m_legacyLevel != m_level.ordinal()) { return m_legacyLevel; } return m_level.ordinal(); }
/** * Returns the severity level of this LogEntry object. * <p> * This is one of the severity levels defined by the * {@link org.osgi.service.logLogService} interface. * @return severity level of this LogEntry object. * @see org.osgi.service.LogService#LOG_ERROR * @see org.osgi.service.LogService#LOG_WARNING * @see org.osgi.service.LogService#LOG_INFO * @see org.osgi.service.LogService#LOG_DEBUG */ public int getLevel() { if (m_legacyLevel != m_level.ordinal()) { return m_legacyLevel; } return m_level.ordinal(); }
/** * Create a new instance. * @param name the name of the logger used to create the LogEntry * @param bundle the bundle that created the LogEntry object * @param sr the service reference to associate with this LogEntry object * @param level the severity level for this LogEntry object * @param message the message to associate with this LogEntry object * @param exception the exception to associate with this LogEntry object */ LogEntryImpl( final String name, final Bundle bundle, final ServiceReference<?> sr, final LogLevel level, final String message, final Throwable exception, final StackTraceElement stackTraceElement) { this.m_name = name; this.m_bundle = bundle; this.m_exception = LogException.getException(exception); this.m_level = level; this.m_legacyLevel = level.ordinal(); this.m_message = message; this.m_serviceReference = sr; this.m_time = System.currentTimeMillis(); this.m_sequence = m_sequenceGenerator.getAndIncrement(); this.m_threadInfo = Thread.currentThread().getName(); this.m_stackTraceElement = stackTraceElement; }
/** * Create a new instance. * @param name the name of the logger used to create the LogEntry * @param bundle the bundle that created the LogEntry object * @param sr the service reference to associate with this LogEntry object * @param level the severity level for this LogEntry object * @param message the message to associate with this LogEntry object * @param exception the exception to associate with this LogEntry object */ LogEntryImpl( final String name, final Bundle bundle, final ServiceReference<?> sr, final LogLevel level, final String message, final Throwable exception, final StackTraceElement stackTraceElement) { this.m_name = name; this.m_bundle = bundle; this.m_exception = LogException.getException(exception); this.m_level = level; this.m_legacyLevel = level.ordinal(); this.m_message = message; this.m_serviceReference = sr; this.m_time = System.currentTimeMillis(); this.m_sequence = m_sequenceGenerator.getAndIncrement(); this.m_threadInfo = Thread.currentThread().getName(); this.m_stackTraceElement = stackTraceElement; }
this.m_legacyLevel = ((level == LogLevel.TRACE) ? legacyLevel : level.ordinal()); this.m_message = message; this.m_serviceReference = sr;
this.m_legacyLevel = ((level == LogLevel.TRACE) ? legacyLevel : level.ordinal()); this.m_message = message; this.m_serviceReference = sr;
private void log(LogLevel level, String format, Object... arguments) { if (!enabledLevel.implies(level)) { return; } StackTraceElement location = getLocation(); Arguments processedArguments = new Arguments(arguments); String message = processedArguments.isEmpty() ? format : formatMessage(format, processedArguments); logServiceImpl.getFactory().log(logServiceImpl.getBundle(), name, location, processedArguments.serviceReference(), level, level.ordinal(), message.toString(), processedArguments.throwable()); }
private void log(LogLevel level, String format, Object... arguments) { if (!enabledLevel.implies(level)) { return; } StackTraceElement location = getLocation(); Arguments processedArguments = new Arguments(arguments); String message = processedArguments.isEmpty() ? format : formatMessage(format, processedArguments); logServiceImpl.getFactory().log(logServiceImpl.getBundle(), name, location, processedArguments.serviceReference(), level, level.ordinal(), message.toString(), processedArguments.serviceReference(), processedArguments.throwable()); }