# <echo>

[This is preliminary documentation and subject to change.]

Writes a message to the build log or a specified file.

The message can be specified using the `message` attribute or as inline content.

Macros in the message will be expanded.

When writing to a file, the `level` attribute is ignored.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
append | bool | Determines whether the <echo> task should append to the file, or overwrite it. By default, the file will be overwritten. | False
file | file | The file to write the message to. | False
level | Level | The logging level with which the message should be output. The default is `Info`. | False
message | string | The message to output. | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Examples

- Writes a message with level `Debug` to the build log.

      <echo message="Hello, World!" level="Debug" />

- Writes a message with expanded macro to the build log.

      <echo message="Base build directory = ${nant.project.basedir}" />

- Functionally equivalent to the previous example.

      <echo>Base build directory = ${nant.project.basedir}</echo>

- Writes the previous message to a file in the project directory, overwriting the file if it exists.

      <echo file="buildmessage.txt">Base build directory = ${nant.project.basedir}</echo>

### Requirements

Assembly: NAnt.Core (0.85.1932.0)