blob: 1812e913bf7dced7f48bd553d55eb709129ac11a [file] [log] [blame]
slowrdb071b22017-07-07 11:10:25 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
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}