View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugin.logging;
20  
21  /**
22   * This interface supplies the API for providing feedback to the user from the <code>Mojo</code>, using standard
23   * <code>Maven</code> channels.<br>
24   * There should be no big surprises here, although you may notice that the methods accept
25   * <code>java.lang.CharSequence</code> rather than <code>java.lang.String</code>. This is provided mainly as a
26   * convenience, to enable developers to pass things like <code>java.lang.StringBuffer</code> directly into the logger,
27   * rather than formatting first by calling <code>toString()</code>.
28   *
29   * @author jdcasey
30   *
31   * @deprecated Use SLF4J directly
32   */
33  @Deprecated
34  public interface Log {
35      /**
36       * @return true if the <b>debug</b> error level is enabled
37       */
38      boolean isDebugEnabled();
39  
40      /**
41       * Send a message to the user in the <b>debug</b> error level.
42       *
43       * @param content
44       */
45      void debug(CharSequence content);
46  
47      /**
48       * Send a message (and accompanying exception) to the user in the <b>debug</b> error level.<br>
49       * The error's stacktrace will be output when this error level is enabled.
50       *
51       * @param content
52       * @param error
53       */
54      void debug(CharSequence content, Throwable error);
55  
56      /**
57       * Send an exception to the user in the <b>debug</b> error level.<br>
58       * The stack trace for this exception will be output when this error level is enabled.
59       *
60       * @param error
61       */
62      void debug(Throwable error);
63  
64      /**
65       * @return true if the <b>info</b> error level is enabled
66       */
67      boolean isInfoEnabled();
68  
69      /**
70       * Send a message to the user in the <b>info</b> error level.
71       *
72       * @param content
73       */
74      void info(CharSequence content);
75  
76      /**
77       * Send a message (and accompanying exception) to the user in the <b>info</b> error level.<br>
78       * The error's stacktrace will be output when this error level is enabled.
79       *
80       * @param content
81       * @param error
82       */
83      void info(CharSequence content, Throwable error);
84  
85      /**
86       * Send an exception to the user in the <b>info</b> error level.<br>
87       * The stack trace for this exception will be output when this error level is enabled.
88       *
89       * @param error
90       */
91      void info(Throwable error);
92  
93      /**
94       * @return true if the <b>warn</b> error level is enabled
95       */
96      boolean isWarnEnabled();
97  
98      /**
99       * Send a message to the user in the <b>warn</b> error level.
100      *
101      * @param content
102      */
103     void warn(CharSequence content);
104 
105     /**
106      * Send a message (and accompanying exception) to the user in the <b>warn</b> error level.<br>
107      * The error's stacktrace will be output when this error level is enabled.
108      *
109      * @param content
110      * @param error
111      */
112     void warn(CharSequence content, Throwable error);
113 
114     /**
115      * Send an exception to the user in the <b>warn</b> error level.<br>
116      * The stack trace for this exception will be output when this error level is enabled.
117      *
118      * @param error
119      */
120     void warn(Throwable error);
121 
122     /**
123      * @return true if the <b>error</b> error level is enabled
124      */
125     boolean isErrorEnabled();
126 
127     /**
128      * Send a message to the user in the <b>error</b> error level.
129      *
130      * @param content
131      */
132     void error(CharSequence content);
133 
134     /**
135      * Send a message (and accompanying exception) to the user in the <b>error</b> error level.<br>
136      * The error's stacktrace will be output when this error level is enabled.
137      *
138      * @param content
139      * @param error
140      */
141     void error(CharSequence content, Throwable error);
142 
143     /**
144      * Send an exception to the user in the <b>error</b> error level.<br>
145      * The stack trace for this exception will be output when this error level is enabled.
146      *
147      * @param error
148      */
149     void error(Throwable error);
150 }