From: Alexandre Montplaisir Date: Tue, 15 Sep 2015 17:57:09 +0000 (-0400) Subject: Add a toString() to Java agent's EventRule X-Git-Tag: v2.8.0-rc1~59 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=410d88da89c9a9e8cce20f5f9b244d23757de7d1;p=lttng-ust.git Add a toString() to Java agent's EventRule Helps with debugging and eventually for pretty-printing. Signed-off-by: Alexandre Montplaisir Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/EventRule.java b/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/EventRule.java index c25045d9..8af51a38 100644 --- a/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/EventRule.java +++ b/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/EventRule.java @@ -131,4 +131,10 @@ public class EventRule { return true; } + @Override + public String toString() { + return "Event name = " + getEventName() + + ", Log level selector = (" + getLogLevelSelector().toString() + ")" + + ", Filter string = " + getFilterString(); + } } diff --git a/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/LogLevelSelector.java b/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/LogLevelSelector.java index 87d4172c..f6f6a396 100644 --- a/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/LogLevelSelector.java +++ b/liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/session/LogLevelSelector.java @@ -188,4 +188,12 @@ public class LogLevelSelector { } return true; } + + @Override + public String toString() { + if (getLogLevelType() == LogLevelType.LTTNG_EVENT_LOGLEVEL_ALL) { + return LogLevelType.LTTNG_EVENT_LOGLEVEL_ALL.toString(); + } + return String.valueOf(getLogLevel()) + ", " + getLogLevelType().toString(); + } }