ExecutionLogger
public class FileLogger extends java.lang.Object implements ExecutionLogger
Constructor | Description |
---|---|
FileLogger(java.io.File outputFile) |
Creates a new logger that writes to the specified file.
|
FileLogger(java.io.File outputFile,
org.apache.maven.plugin.logging.Log log) |
Creates a new logger that writes to the specified file and optionally mirrors messages to the given mojo logger.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the underlying file stream.
|
void |
consumeLine(java.lang.String line) |
Writes the specified line to the log file and optionally to the mojo logger.
|
protected void |
finalize() |
Closes the underlying file stream.
|
java.io.File |
getOutputFile() |
Gets the path to the output file.
|
java.io.PrintStream |
getPrintStream() |
Gets the underlying stream used to write message to the log file.
|
public FileLogger(java.io.File outputFile) throws java.io.IOException
outputFile
- The path to the output file, must not be null
.java.io.IOException
- If the output file could not be created.public FileLogger(java.io.File outputFile, org.apache.maven.plugin.logging.Log log) throws java.io.IOException
outputFile
- The path to the output file, must not be null
.log
- The mojo logger to additionally output messages to, may be null
if not used.java.io.IOException
- If the output file could not be created.public java.io.File getOutputFile()
null
.public java.io.PrintStream getPrintStream()
getPrintStream
in interface ExecutionLogger
null
.public void consumeLine(java.lang.String line)
consumeLine
in interface ExecutionLogger
line
- The message to log.public void close()
protected void finalize()
finalize
in class java.lang.Object