Methods Summary |
---|
public void | addText(java.lang.String msg)Set a multiline message.
message += getProject().replaceProperties(msg);
|
public void | execute()Does the work.
// CheckStyle:VisibilityModifier ON
if (file == null) {
log(message, logLevel);
} else {
Writer out = null;
try {
String filename = file.getAbsolutePath();
if (encoding == null || encoding.length() == 0) {
out = new FileWriter(filename, append);
} else {
out = new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(filename, append), encoding));
}
out.write(message, 0, message.length());
} catch (IOException ioe) {
throw new BuildException(ioe, getLocation());
} finally {
FileUtils.close(out);
}
}
|
public void | setAppend(boolean append)If true, append to existing file.
this.append = append;
|
public void | setEncoding(java.lang.String encoding)Declare the encoding to use when outputting to a file;
Use "" for the platform's default encoding.
this.encoding = encoding;
|
public void | setFile(java.io.File file)File to write to.
this.file = file;
|
public void | setLevel(org.apache.tools.ant.taskdefs.Echo$EchoLevel echoLevel)Set the logging level. Level should be one of
- error
- warning
- info
- verbose
- debug
The default is "warning" to ensure that messages are
displayed by default when using the -quiet command line option.
logLevel = echoLevel.getLevel();
|
public void | setMessage(java.lang.String msg)Message to write.
this.message = msg;
|