1. /*
  2. * Copyright 2000-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;
  18. import java.io.PrintStream;
  19. /**
  20. * Interface used by Ant to log the build output.
  21. *
  22. * A build logger is a build listener which has the 'right' to send output to
  23. * the ant log, which is usually <code>System.out</code> unless redirected by
  24. * the <code>-logfile</code> option.
  25. *
  26. */
  27. public interface BuildLogger extends BuildListener {
  28. /**
  29. * Sets the highest level of message this logger should respond to.
  30. *
  31. * Only messages with a message level lower than or equal to the
  32. * given level should be written to the log.
  33. * <P>
  34. * Constants for the message levels are in the
  35. * {@link Project Project} class. The order of the levels, from least
  36. * to most verbose, is <code>MSG_ERR</code>, <code>MSG_WARN</code>,
  37. * <code>MSG_INFO</code>, <code>MSG_VERBOSE</code>,
  38. * <code>MSG_DEBUG</code>.
  39. *
  40. * @param level the logging level for the logger.
  41. */
  42. void setMessageOutputLevel(int level);
  43. /**
  44. * Sets the output stream to which this logger is to send its output.
  45. *
  46. * @param output The output stream for the logger.
  47. * Must not be <code>null</code>.
  48. */
  49. void setOutputPrintStream(PrintStream output);
  50. /**
  51. * Sets this logger to produce emacs (and other editor) friendly output.
  52. *
  53. * @param emacsMode <code>true</code> if output is to be unadorned so that
  54. * emacs and other editors can parse files names, etc.
  55. */
  56. void setEmacsMode(boolean emacsMode);
  57. /**
  58. * Sets the output stream to which this logger is to send error messages.
  59. *
  60. * @param err The error stream for the logger.
  61. * Must not be <code>null</code>.
  62. */
  63. void setErrorPrintStream(PrintStream err);
  64. }