1 | /*
|
---|
2 | * Copyright 2002,2004-2005 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant.util;
|
---|
18 |
|
---|
19 | import org.apache.tools.ant.Project;
|
---|
20 | import org.apache.tools.ant.Task;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * A facade that makes logging nicers to use.
|
---|
24 | *
|
---|
25 | */
|
---|
26 | public final class TaskLogger {
|
---|
27 | /**
|
---|
28 | * Task to use to do logging.
|
---|
29 | */
|
---|
30 | private Task m_task;
|
---|
31 |
|
---|
32 | public TaskLogger(final Task task) {
|
---|
33 | this.m_task = task;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void info(final String message) {
|
---|
37 | m_task.log(message, Project.MSG_INFO);
|
---|
38 | }
|
---|
39 |
|
---|
40 | public void error(final String message) {
|
---|
41 | m_task.log(message, Project.MSG_ERR);
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void warning(final String message) {
|
---|
45 | m_task.log(message, Project.MSG_WARN);
|
---|
46 | }
|
---|
47 |
|
---|
48 | public void verbose(final String message) {
|
---|
49 | m_task.log(message, Project.MSG_VERBOSE);
|
---|
50 | }
|
---|
51 |
|
---|
52 | public void debug(final String message) {
|
---|
53 | m_task.log(message, Project.MSG_DEBUG);
|
---|
54 | }
|
---|
55 | }
|
---|