blob: 313e07426be6c99aa671433dec50bcd7acfa6d0e [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001/**
2 * Copyright 2012, Big Switch Networks, Inc.
3 * Originally created by David Erickson, Stanford University
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations
15 * under the License.
16 **/
17
18package net.onrc.onos.of.ctl.annotations;
19
20import java.lang.annotation.ElementType;
21import java.lang.annotation.Target;
22
23/**
24 * Annotation used to document log messages. This can be used to generate
25 * documentation on syslog output.
26 *
27 */
28@Target({ ElementType.TYPE, ElementType.METHOD })
29public @interface LogMessageDoc {
30 public static final String NO_ACTION = "No action is required.";
31 public static final String UNKNOWN_ERROR = "An unknown error occured";
32 public static final String GENERIC_ACTION =
33 "Examine the returned error or exception and take " +
34 "appropriate action.";
35 public static final String CHECK_SWITCH =
36 "Check the health of the indicated switch. " +
37 "Test and troubleshoot IP connectivity.";
38 public static final String CHECK_CONTROLLER =
39 "Verify controller system health, CPU usage, and memory. " +
40 "Rebooting the controller node may help if the controller " +
41 "node is in a distressed state.";
42 public static final String REPORT_CONTROLLER_BUG =
43 "This is likely a defect in the controller. Please report this " +
44 "issue. Restarting the controller or switch may help to " +
45 "alleviate.";
46 public static final String REPORT_SWITCH_BUG =
47 "This is likely a defect in the switch. Please report this " +
48 "issue. Restarting the controller or switch may help to " +
49 "alleviate.";
50
51 /**
52 * The log level for the log message.
53 *
54 * @return the log level as a tring
55 */
56 String level() default "INFO";
57
58 /**
59 * The message that will be printed.
60 *
61 * @return the message
62 */
63 String message() default UNKNOWN_ERROR;
64
65 /**
66 * An explanation of the meaning of the log message.
67 *
68 * @return the explanation
69 */
70 String explanation() default UNKNOWN_ERROR;
71
72 /**
73 * The recommendated action associated with the log message.
74 *
75 * @return the recommendation
76 */
77 String recommendation() default NO_ACTION;
78}