use of org.osgi.service.log.LogService in project sling by apache.
the class MimeTypeServiceImpl method log.
private void log(int level, String message, Throwable t) {
LogService log = this.logService;
if (log != null) {
log.log(level, message, t);
} else {
PrintStream out = (level == LogService.LOG_ERROR) ? System.err : System.out;
out.println(message);
if (t != null) {
t.printStackTrace(out);
}
}
}
use of org.osgi.service.log.LogService in project felix by apache.
the class TestBNDManifestLoggerInfo method init.
@Before
public void init() {
log = (LogReaderService) osgiHelper.getServiceObject(LogReaderService.class.getName(), null);
if (log == null) {
throw new RuntimeException("No Log Service !");
}
LogService logs = (LogService) osgiHelper.getServiceObject(LogService.class.getName(), null);
logs.log(LogService.LOG_WARNING, "Ready");
}
use of org.osgi.service.log.LogService in project felix by apache.
the class TestSystemLoggerInfo method init.
@Before
public void init() {
log = (LogReaderService) osgiHelper.getServiceObject(LogReaderService.class.getName(), null);
if (log == null) {
throw new RuntimeException("No Log Service !");
}
LogService logs = (LogService) osgiHelper.getServiceObject(LogService.class.getName(), null);
logs.log(LogService.LOG_WARNING, "Ready");
}
use of org.osgi.service.log.LogService in project felix by apache.
the class TestSystemLoggerWarning method init.
@Before
public void init() {
log = (LogReaderService) osgiHelper.getServiceObject(LogReaderService.class.getName(), null);
if (log == null) {
throw new RuntimeException("No Log Service !");
}
LogService logs = (LogService) osgiHelper.getServiceObject(LogService.class.getName(), null);
logs.log(LogService.LOG_WARNING, "Ready");
}
use of org.osgi.service.log.LogService in project felix by apache.
the class DropAllBundlesCommand method doExecute.
protected void doExecute(DeploymentSessionImpl session) throws Exception {
AbstractDeploymentPackage target = session.getTargetAbstractDeploymentPackage();
LogService log = session.getLog();
BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
BundleInfoImpl bundleInfo = orderedTargetBundles[i];
// stale bundle, save a copy for rolling back and uninstall it
String symbolicName = bundleInfo.getSymbolicName();
try {
Bundle bundle = target.getBundle(symbolicName);
if (bundle != null) {
bundle.uninstall();
addRollback(new InstallBundleRunnable(bundle, target, log));
}
} catch (Exception be) {
log.log(LogService.LOG_WARNING, "Bundle '" + symbolicName + "' could not be uninstalled", be);
}
}
}
Aggregations