Repository: karaf Updated Branches: refs/heads/karaf-2.x ae748e051 -> 067a7fc96 refs/heads/karaf-3.0.x 333f7b2db -> c92a530d5 refs/heads/master f4f2c91fa -> e1db56f6c
KARAF-3583 - Add option to configure log level in the client script Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/e1db56f6 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/e1db56f6 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/e1db56f6 Branch: refs/heads/master Commit: e1db56f6c08b7318cfe01e3bc9694d1040e2e1aa Parents: f4f2c91 Author: Jonathan Anstey <[email protected]> Authored: Tue Mar 3 17:00:59 2015 -0330 Committer: Jonathan Anstey <[email protected]> Committed: Tue Mar 3 17:00:59 2015 -0330 ---------------------------------------------------------------------- .../java/org/apache/karaf/client/ClientConfig.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/e1db56f6/client/src/main/java/org/apache/karaf/client/ClientConfig.java ---------------------------------------------------------------------- diff --git a/client/src/main/java/org/apache/karaf/client/ClientConfig.java b/client/src/main/java/org/apache/karaf/client/ClientConfig.java index a409a07..ab08a72 100644 --- a/client/src/main/java/org/apache/karaf/client/ClientConfig.java +++ b/client/src/main/java/org/apache/karaf/client/ClientConfig.java @@ -89,6 +89,20 @@ public class ClientConfig { } } else if (args[i].equals("-v")) { level++; + } else if (args[i].equals("-l")) { + if (args.length <= ++i) { + System.err.println("miss the log level"); + System.exit(1); + } else { + int levelValue = Integer.parseInt(args[i]); + if (levelValue < 0 || levelValue > 4) { + System.err.println("log level can only be 0, 1, 2, 3, or 4"); + System.exit(1); + } else { + level = levelValue; + } + } + } else if (args[i].equals("-r")) { if (args.length <= ++i) { System.err.println("miss the attempts"); @@ -153,6 +167,7 @@ public class ClientConfig { System.out.println(" -u [user] specify the user name"); System.out.println(" --help shows this help message"); System.out.println(" -v raise verbosity"); + System.out.println(" -l set client logging level. Set to 0 for ERROR logging and up to 4 for TRACE."); System.out.println(" -r [attempts] retry connection establishment (up to attempts times)"); System.out.println(" -d [delay] intra-retry delay (defaults to 2 seconds)"); System.out.println(" -b batch mode, specify multiple commands via standard input");
