1. /*
  2. * Copyright 2002,2004 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. import org.apache.tools.ant.Project;
  19. import org.apache.tools.ant.Task;
  20. /**
  21. * A facade that makes logging nicers to use.
  22. *
  23. * @version $Revision: 1.5.2.4 $ $Date: 2004/03/09 17:01:57 $
  24. */
  25. public final class TaskLogger {
  26. /**
  27. * Task to use to do logging.
  28. */
  29. private Task m_task;
  30. public TaskLogger(final Task task) {
  31. this.m_task = task;
  32. }
  33. public void info(final String message) {
  34. m_task.log(message, Project.MSG_INFO);
  35. }
  36. public void error(final String message) {
  37. m_task.log(message, Project.MSG_ERR);
  38. }
  39. public void warning(final String message) {
  40. m_task.log(message, Project.MSG_WARN);
  41. }
  42. public void verbose(final String message) {
  43. m_task.log(message, Project.MSG_VERBOSE);
  44. }
  45. public void debug(final String message) {
  46. m_task.log(message, Project.MSG_DEBUG);
  47. }
  48. }