/* * Copyright (c) 2012,2013 Big Switch Networks, Inc. * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.eclipse.org/legal/epl-v10.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. * * This file incorporates work covered by the following copyright and * permission notice: * * Originally created by David Erickson, Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.sdnplatform.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Target; /** * Annotation used to document log messages. This can be used to generate * documentation on syslog output. * @author readams */ @Target({ElementType.TYPE, ElementType.METHOD}) public @interface LogMessageDoc { public static final String NO_ACTION = "No action is required."; public static final String UNKNOWN_ERROR = "An unknown error occured"; public static final String GENERIC_ACTION = "Examine the returned error or exception and take " + "appropriate action."; public static final String CHECK_SWITCH = "Check the health of the indicated switch. " + "Test and troubleshoot IP connectivity."; public static final String HA_CHECK_SWITCH = "Check the health of the indicated switch. If the problem " + "persists or occurs repeatedly, it likely indicates a defect " + "in the switch HA implementation."; public static final String CHECK_CONTROLLER = "Verify controller system health, CPU usage, and memory. " + "Rebooting the controller node may help if the controller " + "node is in a distressed state."; public static final String REPORT_CONTROLLER_BUG = "This is likely a defect in the controller. Please report this " + "issue. Restarting the controller or switch may help to " + "alleviate."; public static final String REPORT_SWITCH_BUG = "This is likely a defect in the switch. Please report this " + "issue. Restarting the controller or switch may help to " + "alleviate."; public static final String TRANSIENT_CONDITION = "This is normally a transient condition that does not necessarily " + "represent an error. If, however, the condition persists or " + "happens frequently you should report this as a controller defect."; /** * The log level for the log message * @return the log level as a string */ String level() default "INFO"; /** * The message that will be printed * @return the message */ String message() default UNKNOWN_ERROR; /** * An explanation of the meaning of the log message * @return the explanation */ String explanation() default UNKNOWN_ERROR; /** * The recommended action associated with the log message * @return the recommendation */ String recommendation() default NO_ACTION; }