ebc33cad93194f3e12ce07a45327dc6bb13d0e56
[dcaegen2/analytics/tca-gen2.git] / eelf-logger / eelf-logger-api / src / main / java / org / onap / dcae / utils / eelf / logger / api / log / MetricLog.java
1 /*
2  * ================================================================================
3  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain 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,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  *
18  */
19
20 package org.onap.dcae.utils.eelf.logger.api.log;
21
22
23 import org.onap.dcae.utils.eelf.logger.api.info.LogLevelCategory;
24 import org.onap.dcae.utils.eelf.logger.api.spec.MetricLogSpec;
25 import org.onap.dcae.utils.eelf.logger.api.spec.OptionalLogSpec;
26
27 /**
28  * Metric Log captures all log levels supported by metric specifications
29  *
30  * @author Rajiv Singla
31  */
32 public interface MetricLog {
33
34     /**
35      * Logs metric message with provided {@link LogLevelCategory}
36      *
37      * @param logLevelCategory log level category
38      * @param message log message
39      * @param metricLogSpec metric log spec
40      * @param optionalLogSpec optional log spec
41      * @param args argument values for log message interpolation
42      */
43     void log(LogLevelCategory logLevelCategory, String message, MetricLogSpec metricLogSpec,
44              OptionalLogSpec optionalLogSpec, String... args);
45
46     /**
47      * Logs metric message with provided {@link LogLevelCategory} and with default {@link OptionalLogSpec}
48      *
49      * @param logLevelCategory log level category
50      * @param message log message
51      * @param metricLogSpec metric log spec
52      * @param args argument values for log message interpolation
53      */
54     void log(LogLevelCategory logLevelCategory, String message, MetricLogSpec metricLogSpec, String... args);
55
56
57     /**
58      * Logs metric message with provided INFO {@link LogLevelCategory}
59      *
60      * @param message log message
61      * @param metricLogSpec metric log spec
62      * @param args argument values for log message interpolation
63      */
64     void info(String message, MetricLogSpec metricLogSpec, OptionalLogSpec optionalLogSpec, String... args);
65
66     /**
67      * Logs metric message with provided INFO {@link LogLevelCategory} and with default {@link OptionalLogSpec}
68      *
69      * @param message log message
70      * @param metricLogSpec metric log spec
71      * @param args argument values for log message interpolation
72      */
73     void info(String message, MetricLogSpec metricLogSpec, String... args);
74
75
76     /**
77      * Logs metric message with provided WARN {@link LogLevelCategory}
78      *
79      * @param message log message
80      * @param metricLogSpec metric log spec
81      * @param args argument values for log message interpolation
82      */
83     void warn(String message, MetricLogSpec metricLogSpec, OptionalLogSpec optionalLogSpec, String... args);
84
85     /**
86      * Logs metric message with provided WARN {@link LogLevelCategory} and with default {@link OptionalLogSpec}
87      *
88      * @param message log message
89      * @param metricLogSpec metric log spec
90      * @param args argument values for log message interpolation
91      */
92     void warn(String message, MetricLogSpec metricLogSpec, String... args);
93
94     /**
95      * Logs metric message with provided ERROR {@link LogLevelCategory}
96      *
97      * @param message log message
98      * @param metricLogSpec metric log spec
99      * @param args argument values for log message interpolation
100      */
101     void error(String message, MetricLogSpec metricLogSpec, OptionalLogSpec optionalLogSpec, String... args);
102
103     /**
104      * Logs metric message with provided ERROR {@link LogLevelCategory} and with default {@link OptionalLogSpec}
105      *
106      * @param message log message
107      * @param metricLogSpec metric log spec
108      * @param args argument values for log message interpolation
109      */
110     void error(String message, MetricLogSpec metricLogSpec, String... args);
111
112     /**
113      * Logs metric message with provided FATAL {@link LogLevelCategory}
114      *
115      * @param message log message
116      * @param metricLogSpec metric log spec
117      * @param args argument values for log message interpolation
118      */
119     void fatal(String message, MetricLogSpec metricLogSpec, OptionalLogSpec optionalLogSpec, String... args);
120
121     /**
122      * Logs metric message with provided FATAL {@link LogLevelCategory} and with default {@link OptionalLogSpec}
123      *
124      * @param message log message
125      * @param metricLogSpec metric log spec
126      * @param args argument values for log message interpolation
127      */
128     void fatal(String message, MetricLogSpec metricLogSpec, String... args);
129
130 }