blob: 334b4ab517a976fa4ba6bf0c694cca2fe94bf6bd [file] [log] [blame]
slowrdb071b22017-07-07 11:10:25 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015 Open Networking Foundation
slowrdb071b22017-07-07 11:10:25 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.artemis.cli;
18
19import org.apache.karaf.shell.commands.Command;
20import org.apache.karaf.shell.commands.Option;
21import org.onosproject.artemis.impl.ArtemisService;
22import org.onosproject.cli.AbstractShellCommand;
23
24/**
25 * CLI to enable or disable BGP Update message logging.
26 */
27@Command(scope = "artemis", name = "log-messages",
28 description = "Show RIS messages in logger.")
29public class LogOptionsCommand extends AbstractShellCommand {
30
31 @Option(name = "--enable", aliases = "-e", description = "Enable RIS message logging",
32 required = false, multiValued = false)
33 private boolean enable = false;
34
35 @Option(name = "--disable", aliases = "-d", description = "Disable RIS message logging",
36 required = false, multiValued = false)
37 private boolean disable = false;
38
39 @Override
40 protected void execute() {
41 ArtemisService artemisService = get(ArtemisService.class);
42 if (enable) {
43 artemisService.setLogger(true);
44 } else if (disable) {
45 artemisService.setLogger(false);
46 }
47 }
48}