]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/AbstractMavenEmbedderLogger.java
Upgrade to Maven 2.0.9 (in order to support import id DependencyManagement)
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.maven / src / main / java / org / argeo / slc / maven / embedder / AbstractMavenEmbedderLogger.java
1 package org.argeo.slc.maven.embedder;
2
3 /*
4 * Copyright 2001-2005 The Apache Software Foundation.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 /**
20 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
21 * @version $Id: AbstractMavenEmbedderLogger.java 292888 2005-10-01 01:17:36Z jvanzyl $
22 */
23 public abstract class AbstractMavenEmbedderLogger
24 implements MavenEmbedderLogger
25 {
26 private int threshold = MavenEmbedderLogger.LEVEL_INFO;
27
28 private String name;
29
30 public int getThreshold()
31 {
32 return threshold;
33 }
34
35 public void setThreshold( int threshold )
36 {
37 this.threshold = threshold;
38 }
39
40 public String getName()
41 {
42 return name;
43 }
44
45 public void debug( String message )
46 {
47 debug( message, null );
48 }
49
50 public boolean isDebugEnabled()
51 {
52 return threshold <= LEVEL_DEBUG;
53 }
54
55 public void info( String message )
56 {
57 info( message, null );
58 }
59
60 public boolean isInfoEnabled()
61 {
62 return threshold <= LEVEL_INFO;
63 }
64
65 public void warn( String message )
66 {
67 warn( message, null );
68 }
69
70 public boolean isWarnEnabled()
71 {
72 return threshold <= LEVEL_WARN;
73 }
74
75 public void error( String message )
76 {
77 error( message, null );
78 }
79
80 public boolean isErrorEnabled()
81 {
82 return threshold <= LEVEL_ERROR;
83 }
84
85 public void fatalError( String message )
86 {
87 fatalError( message, null );
88 }
89
90 public boolean isFatalErrorEnabled()
91 {
92 return threshold <= LEVEL_FATAL;
93 }
94
95 protected boolean isValidThreshold( int threshold )
96 {
97 if ( threshold == LEVEL_DEBUG )
98 {
99 return true;
100 }
101 if ( threshold == LEVEL_INFO )
102 {
103 return true;
104 }
105 if ( threshold == LEVEL_WARN )
106 {
107 return true;
108 }
109 if ( threshold == LEVEL_ERROR )
110 {
111 return true;
112 }
113 if ( threshold == LEVEL_FATAL )
114 {
115 return true;
116 }
117 if ( threshold == LEVEL_DISABLED )
118 {
119 return true;
120 }
121
122 return false;
123 }
124 }