Listeners and Loggers

We need to briefly touch on two other concepts: listeners and loggers. A listener is a component that is alerted to certain events during the life of a build. A logger is built on top of a listener, and is the component that is responsible for logging information about the build.

Listeners are alerted to seven different events:

  • Build started

  • Build finished

  • Target started

  • Target finished

  • Task started

  • Task finished

  • Message logged

These events should trigger some action in the listener.

For the most part, you really need to know about listeners and what they respond to only if you’re trying to write your own custom task or logger. You can read about building such elements in Chapter 6, “Extending Ant with Custom Tasks, Data Types, ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.