diff --git a/osgi.enroute.logger.simple.provider/bnd.bnd b/osgi.enroute.logger.simple.provider/bnd.bnd index 28d4e48..867231c 100644 --- a/osgi.enroute.logger.simple.provider/bnd.bnd +++ b/osgi.enroute.logger.simple.provider/bnd.bnd @@ -10,19 +10,21 @@ Export-Package: \ org.slf4j.helpers;version=1.7.0,\ org.slf4j;provide:=true;-split-package:=merge-last;version=1.7.0 -Private-Package: \ +Private-Package: \ osgi.enroute.logger.simple.provider,\ org.slf4j.impl;-split-package:=first,\ - org.slf4j.spi + org.slf4j.spi,\ + osgi.enroute.command.enroute.provider Bundle-License: http://opensource.org/licenses/BSD-2-Clause Import-Package: \ aQute.bnd.annotation.metatype;resolution:=optional,\ * Conditional-Package: aQute.lib* --buildpath: \ +-buildpath: \ osgi.enroute.base.api;version=1.0;packages=*,\ - biz.aQute.bndlib;packages=* + biz.aQute.bndlib;packages=*,\ + org.apache.felix.gogo.runtime -testpath: \ osgi.enroute.junit.wrapper diff --git a/osgi.enroute.logger.simple.provider/src/osgi/enroute/logger/simple/provider/LoggerAdminImpl.java b/osgi.enroute.logger.simple.provider/src/osgi/enroute/logger/simple/provider/LoggerAdminImpl.java index ef86983..5b5c5e7 100644 --- a/osgi.enroute.logger.simple.provider/src/osgi/enroute/logger/simple/provider/LoggerAdminImpl.java +++ b/osgi.enroute.logger.simple.provider/src/osgi/enroute/logger/simple/provider/LoggerAdminImpl.java @@ -53,11 +53,15 @@ configurationPolicy = ConfigurationPolicy.OPTIONAL, property = { Debug.COMMAND_SCOPE + "=logger", - Debug.COMMAND_FUNCTION + "=add", - Debug.COMMAND_FUNCTION + "=remove", + Debug.COMMAND_FUNCTION + "=match", + Debug.COMMAND_FUNCTION + "=unmatch", Debug.COMMAND_FUNCTION + "=settings", - Debug.COMMAND_FUNCTION + "=list", - Debug.COMMAND_FUNCTION + "=slf4j" + Debug.COMMAND_FUNCTION + "=loggers", + Debug.COMMAND_FUNCTION + "=slf4j", + Debug.COMMAND_FUNCTION + "=error", + Debug.COMMAND_FUNCTION + "=trace", + Debug.COMMAND_FUNCTION + "=warning", + Debug.COMMAND_FUNCTION + "=info" }) // @formatter:on public class LoggerAdminImpl extends Thread implements LoggerAdmin, Eval { @@ -273,7 +277,11 @@ public void eval(AbstractLogger msf) { return infos; } - public List list() throws Exception { + public List loggers(String glob) throws Exception { + return list(glob); + } + + public List loggers() throws Exception { return list("*"); } @@ -326,7 +334,7 @@ private void error(String string, Exception ee) { * set of options: stacktrace, where * @return the Control added */ - public Control add(Glob pattern, String level, String... options) throws Exception { + public Control match(Glob pattern, String level, String... options) throws Exception { Settings settings = getSettings(); Control control = new Control(); control.level = toLevel(level); @@ -363,7 +371,7 @@ private Level toLevel(String level) throws Exception { * exact pattern) * @return the controls removed */ - public List remove(Glob pattern) throws Exception { + public List unmatch(Glob pattern) throws Exception { Settings settings = getSettings(); List deleted = new ArrayList<>(); @@ -449,4 +457,17 @@ void addLogService(LogService log) { void removeLogService(LogService log) { logs.remove(log); } + + public void error(String msg) { + logger.error(msg); + } + public void info(String msg) { + logger.info(msg); + } + public void trace(String msg) { + logger.trace(msg); + } + public void warning(String msg) { + logger.warn(msg); + } }