Debian Codegraph @

animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant/AntLogger.java

raw
1 package org.codehaus.mojo.animal_sniffer.ant;
2
3 /*
4 * The MIT License
5 *
6 * Copyright (c) 2009, codehaus.org
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27
28 import org.codehaus.mojo.animal_sniffer.logging.Logger;
29 import org.apache.tools.ant.Task;
30 import org.apache.tools.ant.Project;
31
32 /**
33 * An animal sniffer logger that delegates to a maven log.
34 *
35 * @author connollys
36 * @since 1.3
37 */
38 public final class AntLogger
39 implements Logger
40 {
41 private final Task delegate;
42
43 public AntLogger( Task delegate )
44 {
45 this.delegate = delegate;
46 }
47
48 public void info( String message )
49 {
50 delegate.log( message, Project.MSG_INFO );
51 }
52
53 public void info( String message, Throwable t )
54 {
55 delegate.log( message, t, Project.MSG_INFO );
56 }
57
58 public void debug( String message )
59 {
60 delegate.log( message, Project.MSG_DEBUG );
61 }
62
63 public void debug( String message, Throwable t )
64 {
65 delegate.log( message, t, Project.MSG_DEBUG );
66 }
67
68 public void warn( String message )
69 {
70 delegate.log( message, Project.MSG_WARN );
71 }
72
73 public void warn( String message, Throwable t )
74 {
75 delegate.log( message, t, Project.MSG_WARN );
76 }
77
78 public void error( String message )
79 {
80 delegate.log( message, Project.MSG_ERR );
81 }
82
83 public void error( String message, Throwable t )
84 {
85 delegate.log( message, t, Project.MSG_ERR );
86 }
87 }