BuildLogger.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /*
  3. * $Id: BuildLogger.php 905 2010-10-05 16:28:03Z mrook $
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  6. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16. *
  17. * This software consists of voluntary contributions made by many individuals
  18. * and is licensed under the LGPL. For more information please see
  19. * <http://phing.info>.
  20. */
  21. require_once 'phing/BuildListener.php';
  22. /**
  23. * Interface for build loggers.
  24. *
  25. * Build loggers are build listeners but with some additional functionality:
  26. * - They can be configured with a log level (below which they will ignore messages)
  27. * - They have error and output streams
  28. *
  29. * Classes that implement a listener must implement this interface.
  30. *
  31. * @author Hans Lellelid <hans@xmpl.org>
  32. * @version $Revision: 905 $
  33. * @see BuildEvent
  34. * @see Project::addBuildListener()
  35. * @package phing
  36. */
  37. interface BuildLogger extends BuildListener {
  38. /**
  39. * Sets the min log level that this logger should respect.
  40. *
  41. * Messages below this level are ignored.
  42. *
  43. * Constants for the message levels are in Project.php. The order of
  44. * the levels, from least to most verbose, is:
  45. * - Project::MSG_ERR
  46. * - Project::MSG_WARN
  47. * - Project::MSG_INFO
  48. * - Project::MSG_VERBOSE
  49. * - Project::MSG_DEBUG
  50. *
  51. * @param int $level The log level integer (e.g. Project::MSG_VERBOSE, etc.).
  52. */
  53. public function setMessageOutputLevel($level);
  54. /**
  55. * Sets the standard output stream to use.
  56. * @param OutputStream $output Configured output stream (e.g. STDOUT) for standard output.
  57. */
  58. public function setOutputStream(OutputStream $output);
  59. /**
  60. * Sets the output stream to use for errors.
  61. * @param OutputStream $err Configured output stream (e.g. STDERR) for errors.
  62. */
  63. public function setErrorStream(OutputStream $err);
  64. }