Bundle bundle = logEntry.getBundle();
String symbolicName = StringUtil.replace(
bundle.getSymbolicName(), StringPool.PERIOD, StringPool.UNDERLINE);
Log log = LogFactoryUtil.getLog("osgi.logging." + symbolicName);
String message = logEntry.getMessage();
ServiceReference<?> serviceReference = logEntry.getServiceReference();
if (serviceReference != null) {
message += " " + serviceReference.toString();
}
if ((level == LogService.LOG_DEBUG) && log.isDebugEnabled()) {
log.debug(message, logEntry.getException());
}
else if ((level == LogService.LOG_ERROR) && log.isErrorEnabled()) {
log.error(message, logEntry.getException());
}
else if ((level == LogService.LOG_INFO) && log.isInfoEnabled()) {
log.info(message, logEntry.getException());
}
else if ((level == LogService.LOG_WARNING) && log.isWarnEnabled()) {
log.warn(message, logEntry.getException());
}
}