use of org.osgi.service.log.LogEntry in project felix by apache.
the class TestBNDManifestLoggerInfo method getMessages.
private List<String> getMessages(Enumeration<LogEntry> log2) {
List<String> list = new ArrayList<String>();
while (log2.hasMoreElements()) {
LogEntry entry = (LogEntry) log2.nextElement();
list.add(entry.getMessage());
}
return list;
}
use of org.osgi.service.log.LogEntry in project felix by apache.
the class TestSystemLoggerInfo method getMessages.
private List<String> getMessages(Enumeration<LogEntry> log2) {
List<String> list = new ArrayList<String>();
while (log2.hasMoreElements()) {
LogEntry entry = (LogEntry) log2.nextElement();
list.add(entry.getMessage());
}
return list;
}
use of org.osgi.service.log.LogEntry in project felix by apache.
the class TestSystemLoggerWarning method getMessages.
private List<String> getMessages(Enumeration<LogEntry> log2) {
List<String> list = new ArrayList<String>();
while (log2.hasMoreElements()) {
LogEntry entry = (LogEntry) log2.nextElement();
list.add(entry.getMessage());
}
return list;
}
use of org.osgi.service.log.LogEntry in project felix by apache.
the class Log method bundleChanged.
/**
* Called when a bundle event occurs.
* @param event the event that occured
*/
public void bundleChanged(final BundleEvent event) {
int eventType = event.getType();
String message = null;
for (int i = 0; message == null && i < BUNDLE_EVENT_MESSAGES.length; ++i) {
if (eventType >> i == 1) {
message = BUNDLE_EVENT_MESSAGES[i];
}
}
if (message != null) {
LogEntry entry = new LogEntryImpl(event.getBundle(), null, LogService.LOG_INFO, message, null);
addEntry(entry);
}
}
use of org.osgi.service.log.LogEntry in project felix by apache.
the class Log method frameworkEvent.
/**
* Called when a framework event occurs.
* @param event the event that occured
*/
public void frameworkEvent(final FrameworkEvent event) {
int eventType = event.getType();
String message = null;
for (int i = 0; message == null && i < FRAMEWORK_EVENT_MESSAGES.length; ++i) {
if (eventType >> i == 1) {
message = FRAMEWORK_EVENT_MESSAGES[i];
}
}
LogEntry entry = new LogEntryImpl(event.getBundle(), null, (eventType == FrameworkEvent.ERROR) ? LogService.LOG_ERROR : LogService.LOG_INFO, message, event.getThrowable());
addEntry(entry);
}
Aggregations