Kura OSGi - 控制台不查看我的文本

Kura OSGi - Console does not view my text

我正在尝试将输出输出到我的控制台,但它不起作用。我有以下示例代码:

package org.eclipse.kura.example.hello_osgi;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HelloOsgi {

private static final Logger s_logger = LoggerFactory.getLogger(HelloOsgi.class);

private static final String APP_ID = "org.eclipse.kura.example.hello_osgi";

protected void activate(ComponentContext componentContext) {
    s_logger.info("Bundle " + APP_ID + " has started!");

    //console should view this
    s_logger.debug(APP_ID + ": This is a debug message."); 
}

protected void deactivate(ComponentContext componentContext) {
    s_logger.info("Bundle " + APP_ID + " has stopped!");
    }
}

控制台输出:

...
ss
"Framework is launched."

osgi> install file:/Users/myname/eclipseworkspace/org.eclipse.kura.example.hello_osgi
undle id is 1023
osgi> start 1023
1023 ACTIVE org.eclipse.kura.example.hello_osgi_1.0.0.qualifier
osgi> ((HERE SHOULD BE MY TEXT))

另外,让我告诉你,处理 Kura 和 OSGi 对我来说还是个新鲜事。但我认为这个问题本身就足够清楚了。 :D

在此先感谢大家。

日志输出不会转到 OSGi 控制台,而是转到 Kura 日志文件。您应该在 /var/log/kura.log.

中看到您的输出